JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrsdk/CODE_OF_CONDUCT.md000064400000006263150364341760010144 0ustar00# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: - Using welcoming and inclusive language - Being respectful of differing viewpoints and experiences - Gracefully accepting constructive criticism - Focusing on what is best for the community - Showing empathy towards other community members Examples of unacceptable behavior by participants include: - The use of sexualized language or imagery and unwelcome sexual attention or advances - Trolling, insulting/derogatory comments, and personal or political attacks - Public or private harassment - Publishing others' private information, such as a physical or electronic address, without explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at open-source@twilio.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org sdk/composer.json000064400000001556150364341760010067 0ustar00{ "name": "twilio/sdk", "type": "library", "description": "A PHP wrapper for Twilio's API", "keywords": ["twilio", "sms", "api"], "homepage": "https://github.com/twilio/twilio-php", "license": "MIT", "authors": [ { "name": "Twilio API Team", "email": "api@twilio.com" } ], "require": { "php": ">=7.1.0" }, "require-dev": { "guzzlehttp/guzzle": "^6.3 || ^7.0", "phpunit/phpunit": ">=7.0 < 10" }, "suggest": { "guzzlehttp/guzzle": "An HTTP client to execute the API requests" }, "autoload": { "psr-4": { "Twilio\\": "src/Twilio/" } }, "autoload-dev": { "psr-4": { "": "src/Twilio/", "Twilio\\Tests\\": "tests/Twilio/" } }, "config": { "lock": false } }sdk/example/message.php000064400000002175150364341760011133 0ustar00messages->create( $phoneNumber, [ 'from' => $twilioPurchasedNumber, 'body' => "Hey Jenny! Good luck on the bar exam!" ] ); print("Message sent successfully with sid = " . $message->sid ."\n\n"); // Print the last 10 messages $messageList = $client->messages->read([],10); foreach ($messageList as $msg) { print("ID:: ". $msg->sid . " | " . "From:: " . $msg->from . " | " . "TO:: " . $msg->to . " | " . " Status:: " . $msg->status . " | " . " Body:: ". $msg->body ."\n"); }sdk/example/incomingPhoneNumber.php000064400000001543150364341760013453 0ustar00availablePhoneNumbers("XX")->local->read(); // Buy the first phone number if(!empty($numbers)){ $local = $numbers[0]; return $client->incomingPhoneNumbers->create(["phoneNumber" => $local->phoneNumber]); } return null; } // Get a number $number = buyNumber(); print("Twilio purchased phoneNumber: ".$number->phoneNumber."\n");sdk/example/twiML.php000064400000002065150364341760010541 0ustar00 'woman' ]); $play = new \Twilio\TwiML\Voice\Play("https://api.twilio.com/cowbell.mp3", [ 'loop' => 5 ]); $twiml = new VoiceResponse(); $twiml->append($say); $twiml->append($play); print("TwiML Say and Play: \n{$twiml->asXML()}\n"); // Gather, Redirect $twimlResponse = new VoiceResponse(); $gather = $twimlResponse->gather(); $gather->setNumDigits(10); $gather->say("Press 1"); $twimlResponse->redirect("https://example.com"); print("TwiML Gather and Redirect: \n{$twimlResponse->asXML()}\n"); // Dial $twimlResponse = new VoiceResponse(); // A valid phone number formatted with a '+' and a country code (e.g., +16175551212) $callerID = '+XXXXXXXX'; $dial = $twimlResponse->dial('', [ 'callerId' => $callerID, 'action' => 'https:///example.com', 'hangupOnStar' => true, ]); $dial->conference("My Room", ["beep" => "true"]); print("TwiML Dial: \n{$twimlResponse->asXML()}\n"); sdk/example/signingKey.php000064400000001665150364341760011621 0ustar00api->v2010->newSigningKeys->create(); // Switch to guzzle client as the default client $guzzleClient = new Client($signingKey->sid, $signingKey->secret, $sid, null, new \Twilio\Http\GuzzleClient(new \GuzzleHttp\Client)); // The phone number you are querying in E.164 or national format. // If the phone number is provided in national format, please also specify the country in the optional parameter CountryCode. // Otherwise, CountryCode will default to US. $number = "+XXXXXXXXXX"; // Make REST API requests $phone_number = $guzzleClient->lookups->v1->phoneNumbers($number) ->fetch([ "type" => ["carrier"] ]); print_r($phone_number->carrier); sdk/example/call.php000064400000002206150364341760010415 0ustar00calls->create( $to, $from, ["url" => "https://twilio.com"] ); print("Call made successfully with sid: ".$call->sid."\n\n"); // Get some calls $callsList = $client->calls->read([],null,2); foreach ($callsList as $call) { print("Call {$call->sid}: {$call->duration} seconds\n"); }sdk/example/record.php000064400000001536150364341760010765 0ustar00usage->records->read([], 10); foreach ($recordList as $record) { print_r("Record(accountSid=" . $record->accountSid . ", apiVersion=" . $record->apiVersion . ", asOf=" . $record->asOf . ", category=" . $record->category . ", count=" . $record->count . ", countUnit=" . $record->countUnit . ", description=" . $record->description . ", endDate=" . $record->endDate->format("Y-m-d H:i:s") . ", price=" . $record->price . ", priceUnit=" . $record->priceUnit . ", startDate=" . $record->startDate->format("Y-m-d H:i:s") . ", uri=" . $record->uri . ", usage=" . $record->usage . ", usageUnit=" . $record->usageUnit . "\n"); }sdk/example/trunk.php000064400000000552150364341760010647 0ustar00trunking->v1->trunks->create( [ "friendlyName" => "shiny trunk", "secure" => false ] ); print("\n".$trunk."\n");sdk/src/Twilio/ListResource.php000064400000000456150364341760012535 0ustar00version = $version; } public function __toString(): string { return '[ListResource]'; } } sdk/src/Twilio/Version.php000064400000016035150364341760011537 0ustar00domain = $domain; $this->version = null; } /** * Generate an absolute URL from a version relative uri * @param string $uri Version relative uri * @return string Absolute URL */ public function absoluteUrl(string $uri): string { return $this->getDomain()->absoluteUrl($this->relativeUri($uri)); } /** * Generate a domain relative uri from a version relative uri * @param string $uri Version relative uri * @return string Domain relative uri */ public function relativeUri(string $uri): string { return \trim($this->version ?? '', '/') . '/' . \trim($uri, '/'); } public function request(string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $username = null, string $password = null, int $timeout = null): Response { $uri = $this->relativeUri($uri); return $this->getDomain()->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); } /** * Create the best possible exception for the response. * * Attempts to parse the response for Twilio Standard error messages and use * those to populate the exception, falls back to generic error message and * HTTP status code. * * @param Response $response Error response * @param string $header Header for exception message * @return TwilioException */ protected function exception(Response $response, string $header): TwilioException { $message = '[HTTP ' . $response->getStatusCode() . '] ' . $header; $content = $response->getContent(); if (\is_array($content)) { $message .= isset($content['message']) ? ': ' . $content['message'] : ''; $code = isset($content['code']) ? $content['code'] : $response->getStatusCode(); $moreInfo = $content['more_info'] ?? ''; $details = $content['details'] ?? []; return new RestException($message, $code, $response->getStatusCode(), $moreInfo, $details); } return new RestException($message, $response->getStatusCode(), $response->getStatusCode()); } /** * @throws TwilioException */ public function fetch(string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $username = null, string $password = null, int $timeout = null) { $response = $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); // 3XX response codes are allowed here to allow for 307 redirect from Deactivations API. if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 400) { throw $this->exception($response, 'Unable to fetch record'); } return $response->getContent(); } /** * @throws TwilioException */ public function update(string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $username = null, string $password = null, int $timeout = null) { $response = $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { throw $this->exception($response, 'Unable to update record'); } return $response->getContent(); } /** * @throws TwilioException */ public function delete(string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $username = null, string $password = null, int $timeout = null): bool { $response = $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { throw $this->exception($response, 'Unable to delete record'); } return $response->getStatusCode() === 204; } public function readLimits(int $limit = null, int $pageSize = null): array { if ($limit && $pageSize === null) { $pageSize = $limit; } $pageSize = \min($pageSize, self::MAX_PAGE_SIZE); return [ 'limit' => $limit ?: Values::NONE, 'pageSize' => $pageSize ?: Values::NONE, 'pageLimit' => Values::NONE, ]; } public function page(string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $username = null, string $password = null, int $timeout = null): Response { return $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); } public function stream(Page $page, $limit = null, $pageLimit = null): Stream { return new Stream($page, $limit, $pageLimit); } /** * @throws TwilioException */ public function create(string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $username = null, string $password = null, int $timeout = null) { $response = $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { throw $this->exception($response, 'Unable to create record'); } return $response->getContent(); } public function getDomain(): Domain { return $this->domain; } public function __toString(): string { return '[Version]'; } } sdk/src/Twilio/Exceptions/RestException.php000064400000002756150364341760015034 0ustar00statusCode = $statusCode; $this->moreInfo = $moreInfo; $this->details = $details; parent::__construct($message, $code); } /** * Get the HTTP Status Code of the RestException * @return int HTTP Status Code */ public function getStatusCode(): int { return $this->statusCode; } /** * Get more information of the RestException * @return string More error information */ public function getMoreInfo(): string { return $this->moreInfo; } /** * Get the details of the RestException * @return exception details */ public function getDetails(): array { return $this->details; } } sdk/src/Twilio/Exceptions/HttpException.php000064400000000127150364341760015024 0ustar00 $value) { if (\is_array($value)) { $result = self::flatten($value, $result, \array_merge($previous, [$key])); } else { $result[\implode('.', \array_merge($previous, [$key]))] = $value; } } return $result; } public static function prefixedCollapsibleMap($map, string $prefix): array { if ($map === null || $map === Values::NONE) { return []; } $flattened = self::flatten($map); $result = []; foreach ($flattened as $key => $value) { $result[$prefix . '.' . $key] = $value; } return $result; } public static function iso8601Date($dateTime): string { if ($dateTime === null || $dateTime === Values::NONE) { return Values::NONE; } if (\is_string($dateTime)) { return $dateTime; } $utcDate = clone $dateTime; $utcDate->setTimezone(new \DateTimeZone('+0000')); return $utcDate->format('Y-m-d'); } public static function iso8601DateTime($dateTime): string { if ($dateTime === null || $dateTime === Values::NONE) { return Values::NONE; } if (\is_string($dateTime)) { return $dateTime; } $utcDate = clone $dateTime; $utcDate->setTimezone(new \DateTimeZone('+0000')); return $utcDate->format('Y-m-d\TH:i:s\Z'); } public static function booleanToString($boolOrStr) { if ($boolOrStr === null || \is_string($boolOrStr)) { return $boolOrStr; } return $boolOrStr ? 'True' : 'False'; } public static function jsonObject($object) { if (\is_array($object)) { return \json_encode($object); } return $object; } public static function map($values, $map_func) { if (!\is_array($values)) { return $values; } return \array_map($map_func, $values); } } sdk/src/Twilio/TaskRouter/WorkflowRuleTarget.php000064400000002015150364341760016017 0ustar00 * @license http://creativecommons.org/licenses/MIT/ MIT */ class WorkflowRuleTarget implements \JsonSerializable { public $queue; public $expression; public $priority; public $timeout; public function __construct(string $queue, int $priority = null, int $timeout = null, string $expression = null) { $this->queue = $queue; $this->priority = $priority; $this->timeout = $timeout; $this->expression = $expression; } public function jsonSerialize(): array { $json = []; $json['queue'] = $this->queue; if ($this->priority !== null) { $json['priority'] = $this->priority; } if ($this->timeout !== null) { $json['timeout'] = $this->timeout; } if ($this->expression !== null) { $json['expression'] = $this->expression; } return $json; } } sdk/src/Twilio/TaskRouter/WorkflowConfiguration.php000064400000003042150364341760016551 0ustar00 * @license http://creativecommons.org/licenses/MIT/ MIT */ class WorkflowConfiguration implements \JsonSerializable { public $filters; public $default_filter; public function __construct(array $filters, $default_filter = null) { $this->filters = $filters; $this->default_filter = $default_filter; } public function toJSON() { return \json_encode($this); } public static function parse(string $json) { return \json_decode($json); } public static function fromJson(string $json): WorkflowConfiguration { $configJSON = self::parse($json); $default_filter = $configJSON->task_routing->default_filter; $filters = []; foreach ($configJSON->task_routing->filters as $filter) { // friendly_name and filter_friendly_name should map to same variable $friendly_name = $filter->filter_friendly_name ?? $filter->friendly_name; $filter = new WorkflowRule($filter->expression, $filter->targets, $friendly_name); $filters[] = $filter; } return new WorkflowConfiguration($filters, $default_filter); } public function jsonSerialize(): array { $json = []; $task_routing = []; $task_routing['filters'] = $this->filters; $task_routing['default_filter'] = $this->default_filter; $json['task_routing'] = $task_routing; return $json; } } sdk/src/Twilio/TaskRouter/WorkflowRule.php000064400000001505150364341760014653 0ustar00 * @license http://creativecommons.org/licenses/MIT/ MIT */ class WorkflowRule implements \JsonSerializable { public $expression; public $friendly_name; public $targets; public function __construct(string $expression, array $targets, string $friendly_name = null) { $this->expression = $expression; $this->targets = $targets; $this->friendly_name = $friendly_name; } public function jsonSerialize(): array { $json = []; $json['expression'] = $this->expression; $json['targets'] = $this->targets; if ($this->friendly_name !== null) { $json['friendly_name'] = $this->friendly_name; } return $json; } } sdk/src/Twilio/Rest/PricingBase.php000064400000005176150364341760013221 0ustar00baseUrl = 'https://pricing.twilio.com'; } /** * @return V1 Version v1 of pricing */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of pricing */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing]'; } } sdk/src/Twilio/Rest/Accounts/V1.php000064400000007142150364341760013073 0ustar00version = 'v1'; } protected function getAuthTokenPromotion(): AuthTokenPromotionList { if (!$this->_authTokenPromotion) { $this->_authTokenPromotion = new AuthTokenPromotionList($this); } return $this->_authTokenPromotion; } protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } protected function getSafelist(): SafelistList { if (!$this->_safelist) { $this->_safelist = new SafelistList($this); } return $this->_safelist; } protected function getSecondaryAuthToken(): SecondaryAuthTokenList { if (!$this->_secondaryAuthToken) { $this->_secondaryAuthToken = new SecondaryAuthTokenList($this); } return $this->_secondaryAuthToken; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1]'; } } sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php000064400000004222150364341760020206 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php000064400000006745150364341760020401 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/SafelistInstance.php000064400000004120150364341760016323 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.SafelistInstance]'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialList.php000064400000006325150364341760016003 0ustar00solution = [ ]; } /** * Access the aws */ protected function getAws(): AwsList { if (!$this->_aws) { $this->_aws = new AwsList( $this->version ); } return $this->_aws; } /** * Access the publicKey */ protected function getPublicKey(): PublicKeyList { if (!$this->_publicKey) { $this->_publicKey = new PublicKeyList( $this->version ); } return $this->_publicKey; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php000064400000002615150364341760017540 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php000064400000002615150364341760017501 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialInstance.php000064400000003452150364341760016632 0ustar00solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \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]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php000064400000014227150364341760017672 0ustar00solution = [ ]; $this->uri = '/Credentials/PublicKeys'; } /** * Create the PublicKeyInstance * * @param string $publicKey A URL encoded representation of the public key. For example, `-----BEGIN PUBLIC KEY-----MIIBIjANB.pa9xQIDAQAB-----END PUBLIC KEY-----` * @param array|Options $options Optional Arguments * @return PublicKeyInstance Created PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $publicKey, array $options = []): PublicKeyInstance { $options = new Values($options); $data = Values::of([ 'PublicKey' => $publicKey, 'FriendlyName' => $options['friendlyName'], 'AccountSid' => $options['accountSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PublicKeyInstance( $this->version, $payload ); } /** * Reads PublicKeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PublicKeyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PublicKeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PublicKeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PublicKeyPage Page of PublicKeyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PublicKeyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PublicKeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PublicKeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PublicKeyPage Page of PublicKeyInstance */ public function getPage(string $targetUrl): PublicKeyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PublicKeyPage($this->version, $response, $this->solution); } /** * Constructs a PublicKeyContext * * @param string $sid The Twilio-provided string that uniquely identifies the PublicKey resource to delete. */ public function getContext( string $sid ): PublicKeyContext { return new PublicKeyContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.PublicKeyList]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php000064400000011236150364341760020407 0ustar00options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request * * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.CreatePublicKeyOptions ' . $options . ']'; } } class UpdatePublicKeyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.UpdatePublicKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php000064400000010345150364341760017363 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AwsContext Context for this AwsInstance */ protected function proxy(): AwsContext { if (!$this->context) { $this->context = new AwsContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the AwsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AwsInstance * * @return AwsInstance Fetched AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AwsInstance { return $this->proxy()->fetch(); } /** * Update the AwsInstance * * @param array|Options $options Optional Arguments * @return AwsInstance Updated AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AwsInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.AwsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsPage.php000064400000003020150364341760016463 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php000064400000003064150364341760017630 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php000064400000010513150364341760020515 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PublicKeyContext Context for this PublicKeyInstance */ protected function proxy(): PublicKeyContext { if (!$this->context) { $this->context = new PublicKeyContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the PublicKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the PublicKeyInstance * * @return PublicKeyInstance Fetched PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PublicKeyInstance { return $this->proxy()->fetch(); } /** * Update the PublicKeyInstance * * @param array|Options $options Optional Arguments * @return PublicKeyInstance Updated PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): PublicKeyInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.PublicKeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php000064400000011140150364341760017244 0ustar00options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. * * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.CreateAwsOptions ' . $options . ']'; } } class UpdateAwsOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.UpdateAwsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsList.php000064400000014067150364341760016537 0ustar00solution = [ ]; $this->uri = '/Credentials/AWS'; } /** * Create the AwsInstance * * @param string $credentials A string that contains the AWS access credentials in the format `:`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` * @param array|Options $options Optional Arguments * @return AwsInstance Created AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentials, array $options = []): AwsInstance { $options = new Values($options); $data = Values::of([ 'Credentials' => $credentials, 'FriendlyName' => $options['friendlyName'], 'AccountSid' => $options['accountSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AwsInstance( $this->version, $payload ); } /** * Reads AwsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AwsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AwsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AwsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AwsPage Page of AwsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AwsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AwsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AwsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AwsPage Page of AwsInstance */ public function getPage(string $targetUrl): AwsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AwsPage($this->version, $response, $this->solution); } /** * Constructs a AwsContext * * @param string $sid The Twilio-provided string that uniquely identifies the AWS resource to delete. */ public function getContext( string $sid ): AwsContext { return new AwsContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.AwsList]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php000064400000005637150364341760017253 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/AWS/' . \rawurlencode($sid) .''; } /** * Delete the AwsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php000064400000006000150364341760020371 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/PublicKeys/' . \rawurlencode($sid) .''; } /** * Delete the PublicKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/SafelistList.php000064400000006073150364341760015503 0ustar00solution = [ ]; $this->uri = '/SafeList/Numbers'; } /** * Create the SafelistInstance * * @param string $phoneNumber The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return SafelistInstance Created SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber): SafelistInstance { $data = Values::of([ 'PhoneNumber' => $phoneNumber, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SafelistInstance( $this->version, $payload ); } /** * Delete the SafelistInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $params = Values::of([ 'PhoneNumber' => $options['phoneNumber'], ]); return $this->version->delete('DELETE', $this->uri, $params); } /** * Fetch the SafelistInstance * * @param array|Options $options Optional Arguments * @return SafelistInstance Fetched SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): SafelistInstance { $options = new Values($options); $params = Values::of([ 'PhoneNumber' => $options['phoneNumber'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new SafelistInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.SafelistList]'; } } sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php000064400000007426150364341760020337 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php000064400000003124150364341760017436 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php000064400000003546150364341760020255 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialPage.php000064400000003044150364341760015737 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Accounts/V1/SafelistOptions.php000064400000007613150364341760016224 0ustar00options['phoneNumber'] = $phoneNumber; } /** * The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.DeleteSafelistOptions ' . $options . ']'; } } class FetchSafelistOptions extends Options { /** * @param string $phoneNumber The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ public function __construct( string $phoneNumber = Values::NONE ) { $this->options['phoneNumber'] = $phoneNumber; } /** * The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * * @param string $phoneNumber The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.FetchSafelistOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/SafelistPage.php000064400000003030150364341760015432 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SafelistInstance \Twilio\Rest\Accounts\V1\SafelistInstance */ public function buildInstance(array $payload): SafelistInstance { return new SafelistInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.SafelistPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php000064400000003124150364341760017475 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/RoutesBase.php000064400000004522150364341760013101 0ustar00baseUrl = 'https://routes.twilio.com'; } /** * @return V2 Version v2 of routes */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes]'; } } sdk/src/Twilio/Rest/Wireless.php000064400000004160150364341760012620 0ustar00usageRecords instead. */ protected function getUsageRecords(): \Twilio\Rest\Wireless\V1\UsageRecordList { echo "usageRecords is deprecated. Use v1->usageRecords instead."; return $this->v1->usageRecords; } /** * @deprecated Use v1->commands instead. */ protected function getCommands(): \Twilio\Rest\Wireless\V1\CommandList { echo "commands is deprecated. Use v1->commands instead."; return $this->v1->commands; } /** * @deprecated Use v1->commands(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextCommands(string $sid): \Twilio\Rest\Wireless\V1\CommandContext { echo "commands(\$sid) is deprecated. Use v1->commands(\$sid) instead."; return $this->v1->commands($sid); } /** * @deprecated Use v1->ratePlans instead. */ protected function getRatePlans(): \Twilio\Rest\Wireless\V1\RatePlanList { echo "ratePlans is deprecated. Use v1->ratePlans instead."; return $this->v1->ratePlans; } /** * @deprecated Use v1->ratePlans(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextRatePlans(string $sid): \Twilio\Rest\Wireless\V1\RatePlanContext { echo "ratePlans(\$sid) is deprecated. Use v1->ratePlans(\$sid) instead."; return $this->v1->ratePlans($sid); } /** * @deprecated Use v1->sims instead. */ protected function getSims(): \Twilio\Rest\Wireless\V1\SimList { echo "sims is deprecated. Use v1->sims instead."; return $this->v1->sims; } /** * @deprecated Use v1->sims(\$sid) instead. * @param string $sid The SID of the Sim resource to fetch */ protected function contextSims(string $sid): \Twilio\Rest\Wireless\V1\SimContext { echo "sims(\$sid) is deprecated. Use v1->sims(\$sid) instead."; return $this->v1->sims($sid); } }sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php000064400000013627150364341760021257 0ustar00solution = [ 'accountSid' => $accountSid, 'recordingSid' => $recordingSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($recordingSid) .'/Transcriptions.json'; } /** * Reads TranscriptionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TranscriptionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TranscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TranscriptionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TranscriptionPage Page of TranscriptionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TranscriptionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TranscriptionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TranscriptionPage Page of TranscriptionInstance */ public function getPage(string $targetUrl): TranscriptionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Constructs a TranscriptionContext * * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. */ public function getContext( string $sid ): TranscriptionContext { return new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['recordingSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TranscriptionList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php000064400000003203150364341760020532 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php000064400000012314150364341760022100 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'duration' => Values::array_get($payload, 'duration'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'recordingSid' => Values::array_get($payload, 'recording_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'transcriptionText' => Values::array_get($payload, 'transcription_text'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'recordingSid' => $recordingSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TranscriptionContext Context for this TranscriptionInstance */ protected function proxy(): TranscriptionContext { if (!$this->context) { $this->context = new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['recordingSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php000064400000012267150364341760021434 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'addOnSid' => Values::array_get($payload, 'add_on_sid'), 'addOnConfigurationSid' => Values::array_get($payload, 'add_on_configuration_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'referenceSid' => Values::array_get($payload, 'reference_sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AddOnResultContext Context for this AddOnResultInstance */ protected function proxy(): AddOnResultContext { if (!$this->context) { $this->context = new AddOnResultContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AddOnResultInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AddOnResultInstance * * @return AddOnResultInstance Fetched AddOnResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddOnResultInstance { return $this->proxy()->fetch(); } /** * Access the payloads */ protected function getPayloads(): PayloadList { return $this->proxy()->payloads; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddOnResultInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php000064400000011266150364341760021312 0ustar00solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($referenceSid) .'/AddOnResults/' . \rawurlencode($sid) .'.json'; } /** * Delete the AddOnResultInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php000064400000013511150364341760020574 0ustar00solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($referenceSid) .'/AddOnResults.json'; } /** * Reads AddOnResultInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AddOnResultInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AddOnResultInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AddOnResultInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AddOnResultPage Page of AddOnResultInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AddOnResultPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AddOnResultPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AddOnResultInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AddOnResultPage Page of AddOnResultInstance */ public function getPage(string $targetUrl): AddOnResultPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AddOnResultPage($this->version, $response, $this->solution); } /** * Constructs a AddOnResultContext * * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to delete. */ public function getContext( string $sid ): AddOnResultContext { return new AddOnResultContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AddOnResultList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php000064400000005735150364341760021771 0ustar00solution = [ 'accountSid' => $accountSid, 'recordingSid' => $recordingSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($recordingSid) .'/Transcriptions/' . \rawurlencode($sid) .'.json'; } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php000064400000014163150364341760022171 0ustar00solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($referenceSid) .'/AddOnResults/' . \rawurlencode($addOnResultSid) .'/Payloads.json'; } /** * Reads PayloadInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PayloadInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PayloadInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PayloadInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PayloadPage Page of PayloadInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PayloadPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PayloadPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PayloadInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PayloadPage Page of PayloadInstance */ public function getPage(string $targetUrl): PayloadPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PayloadPage($this->version, $response, $this->solution); } /** * Constructs a PayloadContext * * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to delete. */ public function getContext( string $sid ): PayloadContext { return new PayloadContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.PayloadList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php000064400000003246150364341760022132 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php000064400000012417150364341760023022 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'addOnResultSid' => Values::array_get($payload, 'add_on_result_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'label' => Values::array_get($payload, 'label'), 'addOnSid' => Values::array_get($payload, 'add_on_sid'), 'addOnConfigurationSid' => Values::array_get($payload, 'add_on_configuration_sid'), 'contentType' => Values::array_get($payload, 'content_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'referenceSid' => Values::array_get($payload, 'reference_sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PayloadContext Context for this PayloadInstance */ protected function proxy(): PayloadContext { if (!$this->context) { $this->context = new PayloadContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the PayloadInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the PayloadInstance * * @return PayloadInstance Fetched PayloadInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PayloadInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PayloadInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php000064400000006345150364341760022705 0ustar00solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($referenceSid) .'/AddOnResults/' . \rawurlencode($addOnResultSid) .'/Payloads/' . \rawurlencode($sid) .'.json'; } /** * Delete the PayloadInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php000064400000003217150364341760021212 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php000064400000003162150364341760020101 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipInstance.php000064400000003732150364341760016064 0ustar00solution = ['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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyList.php000064400000004263150364341760015702 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php000064400000005270150364341760020051 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyPage.php000064400000003036150364341760015166 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageOptions.php000064400000133244150364341760016606 0ustar00=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @return ReadMessageOptions Options builder */ public static function read( string $to = Values::NONE, string $from = Values::NONE, string $dateSentBefore = null, string $dateSent = null, string $dateSentAfter = null ): ReadMessageOptions { return new ReadMessageOptions( $to, $from, $dateSentBefore, $dateSent, $dateSentAfter ); } /** * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string * @param string $status * @return UpdateMessageOptions Options builder */ public static function update( string $body = Values::NONE, string $status = Values::NONE ): UpdateMessageOptions { return new UpdateMessageOptions( $body, $status ); } } class CreateMessageOptions extends Options { /** * @param string $from The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. * @param string $body The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). * @param string[] $mediaUrl The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. * @param string $contentSid For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). * @param string $statusCallback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). * @param string $applicationSid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. * @param string $maxPrice The maximum price in US dollars that you are willing to pay for this Message's delivery. The value can have up to four decimal places. When the `max_price` parameter is provided, the cost of a message is checked before it is sent. If the cost exceeds `max_price`, the message is not sent and the Message `status` is `failed`. * @param bool $provideFeedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. * @param int $attempt Total number of attempts made (including this request) to send the message regardless of the provider used * @param int $validityPeriod The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) * @param bool $forceDelivery Reserved * @param string $contentRetention * @param string $addressRetention * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. * @param string[] $persistentAction Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). * @param bool $shortenUrls For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. * @param string $scheduleType * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. * @param bool $sendAsMms If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. * @param string $contentVariables For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. * @param string $riskCheck */ public function __construct( string $from = Values::NONE, string $messagingServiceSid = Values::NONE, string $body = Values::NONE, array $mediaUrl = Values::ARRAY_NONE, string $contentSid = Values::NONE, string $statusCallback = Values::NONE, string $applicationSid = Values::NONE, string $maxPrice = Values::NONE, bool $provideFeedback = Values::BOOL_NONE, int $attempt = Values::INT_NONE, int $validityPeriod = Values::INT_NONE, bool $forceDelivery = Values::BOOL_NONE, string $contentRetention = Values::NONE, string $addressRetention = Values::NONE, bool $smartEncoded = Values::BOOL_NONE, array $persistentAction = Values::ARRAY_NONE, bool $shortenUrls = Values::BOOL_NONE, string $scheduleType = Values::NONE, \DateTime $sendAt = null, bool $sendAsMms = Values::BOOL_NONE, string $contentVariables = Values::NONE, string $riskCheck = Values::NONE ) { $this->options['from'] = $from; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; $this->options['contentSid'] = $contentSid; $this->options['statusCallback'] = $statusCallback; $this->options['applicationSid'] = $applicationSid; $this->options['maxPrice'] = $maxPrice; $this->options['provideFeedback'] = $provideFeedback; $this->options['attempt'] = $attempt; $this->options['validityPeriod'] = $validityPeriod; $this->options['forceDelivery'] = $forceDelivery; $this->options['contentRetention'] = $contentRetention; $this->options['addressRetention'] = $addressRetention; $this->options['smartEncoded'] = $smartEncoded; $this->options['persistentAction'] = $persistentAction; $this->options['shortenUrls'] = $shortenUrls; $this->options['scheduleType'] = $scheduleType; $this->options['sendAt'] = $sendAt; $this->options['sendAsMms'] = $sendAsMms; $this->options['contentVariables'] = $contentVariables; $this->options['riskCheck'] = $riskCheck; } /** * The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. * * @param string $from The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. * * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). * * @param string $body The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. * * @param string[] $mediaUrl The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. * @return $this Fluent Builder */ public function setMediaUrl(array $mediaUrl): self { $this->options['mediaUrl'] = $mediaUrl; return $this; } /** * For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). * * @param string $contentSid For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). * @return $this Fluent Builder */ public function setContentSid(string $contentSid): self { $this->options['contentSid'] = $contentSid; return $this; } /** * The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). * * @param string $statusCallback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. * * @param string $applicationSid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. * @return $this Fluent Builder */ public function setApplicationSid(string $applicationSid): self { $this->options['applicationSid'] = $applicationSid; return $this; } /** * The maximum price in US dollars that you are willing to pay for this Message's delivery. The value can have up to four decimal places. When the `max_price` parameter is provided, the cost of a message is checked before it is sent. If the cost exceeds `max_price`, the message is not sent and the Message `status` is `failed`. * * @param string $maxPrice The maximum price in US dollars that you are willing to pay for this Message's delivery. The value can have up to four decimal places. When the `max_price` parameter is provided, the cost of a message is checked before it is sent. If the cost exceeds `max_price`, the message is not sent and the Message `status` is `failed`. * @return $this Fluent Builder */ public function setMaxPrice(string $maxPrice): self { $this->options['maxPrice'] = $maxPrice; return $this; } /** * Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. * * @param bool $provideFeedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. * @return $this Fluent Builder */ public function setProvideFeedback(bool $provideFeedback): self { $this->options['provideFeedback'] = $provideFeedback; return $this; } /** * Total number of attempts made (including this request) to send the message regardless of the provider used * * @param int $attempt Total number of attempts made (including this request) to send the message regardless of the provider used * @return $this Fluent Builder */ public function setAttempt(int $attempt): self { $this->options['attempt'] = $attempt; return $this; } /** * The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) * * @param int $validityPeriod The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) * @return $this Fluent Builder */ public function setValidityPeriod(int $validityPeriod): self { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved * * @param bool $forceDelivery Reserved * @return $this Fluent Builder */ public function setForceDelivery(bool $forceDelivery): self { $this->options['forceDelivery'] = $forceDelivery; return $this; } /** * @param string $contentRetention * @return $this Fluent Builder */ public function setContentRetention(string $contentRetention): self { $this->options['contentRetention'] = $contentRetention; return $this; } /** * @param string $addressRetention * @return $this Fluent Builder */ public function setAddressRetention(string $addressRetention): self { $this->options['addressRetention'] = $addressRetention; return $this; } /** * Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. * * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmartEncoded(bool $smartEncoded): self { $this->options['smartEncoded'] = $smartEncoded; return $this; } /** * Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). * * @param string[] $persistentAction Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). * @return $this Fluent Builder */ public function setPersistentAction(array $persistentAction): self { $this->options['persistentAction'] = $persistentAction; return $this; } /** * For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. * * @param bool $shortenUrls For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. * @return $this Fluent Builder */ public function setShortenUrls(bool $shortenUrls): self { $this->options['shortenUrls'] = $shortenUrls; return $this; } /** * @param string $scheduleType * @return $this Fluent Builder */ public function setScheduleType(string $scheduleType): self { $this->options['scheduleType'] = $scheduleType; return $this; } /** * The time that Twilio will send the message. Must be in ISO 8601 format. * * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. * @return $this Fluent Builder */ public function setSendAt(\DateTime $sendAt): self { $this->options['sendAt'] = $sendAt; return $this; } /** * If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. * * @param bool $sendAsMms If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. * @return $this Fluent Builder */ public function setSendAsMms(bool $sendAsMms): self { $this->options['sendAsMms'] = $sendAsMms; return $this; } /** * For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. * * @param string $contentVariables For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. * @return $this Fluent Builder */ public function setContentVariables(string $contentVariables): self { $this->options['contentVariables'] = $contentVariables; return $this; } /** * @param string $riskCheck * @return $this Fluent Builder */ public function setRiskCheck(string $riskCheck): self { $this->options['riskCheck'] = $riskCheck; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $to Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` * @param string $from Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` * @param string $dateSentBefore Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ public function __construct( string $to = Values::NONE, string $from = Values::NONE, string $dateSentBefore = null, string $dateSent = null, string $dateSentAfter = null ) { $this->options['to'] = $to; $this->options['from'] = $from; $this->options['dateSentBefore'] = $dateSentBefore; $this->options['dateSent'] = $dateSent; $this->options['dateSentAfter'] = $dateSentAfter; } /** * Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` * * @param string $to Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` * * @param string $from Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * * @param string $dateSentBefore Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @return $this Fluent Builder */ public function setDateSentBefore(string $dateSentBefore): self { $this->options['dateSentBefore'] = $dateSentBefore; return $this; } /** * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @return $this Fluent Builder */ public function setDateSent(string $dateSent): self { $this->options['dateSent'] = $dateSent; return $this; } /** * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @return $this Fluent Builder */ public function setDateSentAfter(string $dateSentAfter): self { $this->options['dateSentAfter'] = $dateSentAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string * @param string $status */ public function __construct( string $body = Values::NONE, string $status = Values::NONE ) { $this->options['body'] = $body; $this->options['status'] = $status; } /** * The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string * * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php000064400000003256150364341760022051 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyContext.php000064400000006355150364341760015745 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Keys/' . \rawurlencode($sid) .'.json'; } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodePage.php000064400000003102150364341760016322 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php000064400000026157150364341760020414 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers.json'; } /** * Create the IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Created IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): IncomingPhoneNumberInstance { $options = new Values($options); $data = Values::of([ 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], 'PhoneNumber' => $options['phoneNumber'], 'AreaCode' => $options['areaCode'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IncomingPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads IncomingPhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IncomingPhoneNumberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams IncomingPhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IncomingPhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IncomingPhoneNumberPage Page of IncomingPhoneNumberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IncomingPhoneNumberPage { $options = new Values($options); $params = Values::of([ 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IncomingPhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IncomingPhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IncomingPhoneNumberPage Page of IncomingPhoneNumberInstance */ public function getPage(string $targetUrl): IncomingPhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IncomingPhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a IncomingPhoneNumberContext * * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete. */ public function getContext( string $sid ): IncomingPhoneNumberContext { return new IncomingPhoneNumberContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList( $this->version, $this->solution['accountSid'] ); } return $this->_tollFree; } /** * Access the local */ protected function getLocal(): LocalList { if (!$this->_local) { $this->_local = new LocalList( $this->version, $this->solution['accountSid'] ); } return $this->_local; } /** * Access the mobile */ protected function getMobile(): MobileList { if (!$this->_mobile) { $this->_mobile = new MobileList( $this->version, $this->solution['accountSid'] ); } return $this->_mobile; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IncomingPhoneNumberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php000064400000005243150364341760016532 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueOptions.php000064400000010534150364341760016302 0ustar00options['maxSize'] = $maxSize; } /** * The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * @return $this Fluent Builder */ public function setMaxSize(int $maxSize): self { $this->options['maxSize'] = $maxSize; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateQueueOptions ' . $options . ']'; } } class UpdateQueueOptions extends Options { /** * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. */ public function __construct( string $friendlyName = Values::NONE, int $maxSize = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['maxSize'] = $maxSize; } /** * A descriptive string that you created to describe this resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * @return $this Fluent Builder */ public function setMaxSize(int $maxSize): self { $this->options['maxSize'] = $maxSize; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateQueueOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php000064400000101474150364341760017465 0ustar00options['apiVersion'] = $apiVersion; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsStatusCallback'] = $smsStatusCallback; $this->options['messageStatusCallback'] = $messageStatusCallback; $this->options['friendlyName'] = $friendlyName; $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. * * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when the phone number assigned to this application receives a call. * * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL we should call using a POST method to send status information about SMS messages sent by the application. * * @param string $smsStatusCallback The URL we should call using a POST method to send status information about SMS messages sent by the application. * @return $this Fluent Builder */ public function setSmsStatusCallback(string $smsStatusCallback): self { $this->options['smsStatusCallback'] = $smsStatusCallback; return $this; } /** * The URL we should call using a POST method to send message status information to your application. * * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @return $this Fluent Builder */ public function setMessageStatusCallback(string $messageStatusCallback): self { $this->options['messageStatusCallback'] = $messageStatusCallback; return $this; } /** * A descriptive string that you create to describe the new application. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new application. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self { $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateApplicationOptions ' . $options . ']'; } } class ReadApplicationOptions extends Options { /** * @param string $friendlyName The string that identifies the Application resources to read. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * The string that identifies the Application resources to read. * * @param string $friendlyName The string that identifies the Application resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadApplicationOptions ' . $options . ']'; } } class UpdateApplicationOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. */ public function __construct( string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, bool $publicApplicationConnectEnabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['apiVersion'] = $apiVersion; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsStatusCallback'] = $smsStatusCallback; $this->options['messageStatusCallback'] = $messageStatusCallback; $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. * * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when the phone number assigned to this application receives a call. * * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. * * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. * @return $this Fluent Builder */ public function setSmsStatusCallback(string $smsStatusCallback): self { $this->options['smsStatusCallback'] = $smsStatusCallback; return $this; } /** * The URL we should call using a POST method to send message status information to your application. * * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @return $this Fluent Builder */ public function setMessageStatusCallback(string $messageStatusCallback): self { $this->options['messageStatusCallback'] = $messageStatusCallback; return $this; } /** * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self { $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateApplicationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php000064400000012760150364341760017401 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php000064400000004152150364341760016417 0ustar00options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateNewKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallContext.php000064400000024154150364341760016065 0ustar00solution = [ '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 userDefinedMessageSubscriptions */ protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList { if (!$this->_userDefinedMessageSubscriptions) { $this->_userDefinedMessageSubscriptions = new UserDefinedMessageSubscriptionList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_userDefinedMessageSubscriptions; } /** * Access the events */ protected function getEvents(): EventList { if (!$this->_events) { $this->_events = new EventList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_events; } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_notifications; } /** * Access the userDefinedMessages */ protected function getUserDefinedMessages(): UserDefinedMessageList { if (!$this->_userDefinedMessages) { $this->_userDefinedMessages = new UserDefinedMessageList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_userDefinedMessages; } /** * Access the siprec */ protected function getSiprec(): SiprecList { if (!$this->_siprec) { $this->_siprec = new SiprecList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_siprec; } /** * Access the streams */ protected function getStreams(): StreamList { if (!$this->_streams) { $this->_streams = new StreamList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_streams; } /** * Access the payments */ protected function getPayments(): PaymentList { if (!$this->_payments) { $this->_payments = new PaymentList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_payments; } /** * 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.CallContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php000064400000012777150364341760022147 0ustar00solution = [ 'accountSid' => $accountSid, 'addressSid' => $addressSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Addresses/' . \rawurlencode($addressSid) .'/DependentPhoneNumbers.json'; } /** * Reads DependentPhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DependentPhoneNumberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DependentPhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DependentPhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DependentPhoneNumberPage Page of DependentPhoneNumberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DependentPhoneNumberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DependentPhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DependentPhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DependentPhoneNumberPage Page of DependentPhoneNumberInstance */ public function getPage(string $targetUrl): DependentPhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DependentPhoneNumberPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DependentPhoneNumberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php000064400000003263150364341760022076 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php000064400000012514150364341760022765 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionList.php000064400000013064150364341760017336 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Transcriptions.json'; } /** * Reads TranscriptionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TranscriptionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TranscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TranscriptionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TranscriptionPage Page of TranscriptionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TranscriptionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TranscriptionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TranscriptionPage Page of TranscriptionInstance */ public function getPage(string $targetUrl): TranscriptionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Constructs a TranscriptionContext * * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. */ public function getContext( string $sid ): TranscriptionContext { return new TranscriptionContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TranscriptionList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyInstance.php000064400000010406150364341760016055 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return KeyContext Context for this KeyInstance */ protected function proxy(): KeyContext { if (!$this->context) { $this->context = new KeyContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { return $this->proxy()->fetch(); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): KeyInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.KeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueContext.php000064400000011770150364341760016276 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Queues/' . \rawurlencode($sid) .'.json'; } /** * Delete the QueueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingInstance.php000064400000014220150364341760017237 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), 'uri' => Values::array_get($payload, 'uri'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'mediaUrl' => Values::array_get($payload, 'media_url'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RecordingInstance * * @param array|Options $options Optional Arguments * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): RecordingInstance { return $this->proxy()->fetch($options); } /** * Access the addOnResults */ protected function getAddOnResults(): AddOnResultList { return $this->proxy()->addOnResults; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { return $this->proxy()->transcriptions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenPage.php000064400000003052150364341760015514 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php000064400000004224150364341760017736 0ustar00options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateNewSigningKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php000064400000013042150364341760017253 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php000064400000003132150364341760017154 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php000064400000007617150364341760017251 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/ConnectApps/' . \rawurlencode($sid) .'.json'; } /** * Delete the ConnectAppInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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' => $options['permissions'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConnectAppInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConnectAppContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php000064400000003110150364341760016476 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php000064400000005704150364341760020402 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php000064400000010645150364341760017735 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php000064400000003131150364341760017035 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php000064400000016752150364341760017631 0ustar00=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @return ReadMediaOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ): ReadMediaOptions { return new ReadMediaOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter ); } } class ReadMediaOptions extends Options { /** * @param string $dateCreatedBefore Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * * @param string $dateCreatedBefore Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMediaOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaList.php000064400000014346150364341760017106 0ustar00solution = [ 'accountSid' => $accountSid, 'messageSid' => $messageSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Messages/' . \rawurlencode($messageSid) .'/Media.json'; } /** * Reads MediaInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MediaInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MediaInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MediaInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MediaPage Page of MediaInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MediaPage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateCreated>' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MediaPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MediaInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MediaPage Page of MediaInstance */ public function getPage(string $targetUrl): MediaPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MediaPage($this->version, $response, $this->solution); } /** * Constructs a MediaContext * * @param string $sid The unique identifier of the to-be-deleted Media resource. */ public function getContext( string $sid ): MediaContext { return new MediaContext( $this->version, $this->solution['accountSid'], $this->solution['messageSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MediaList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php000064400000003153150364341760017506 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php000064400000005453150364341760017616 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php000064400000003250150364341760020263 0ustar00options['outcome'] = $outcome; } /** * @param string $outcome * @return $this Fluent Builder */ public function setOutcome(string $outcome): self { $this->options['outcome'] = $outcome; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateFeedbackOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php000064400000004766150364341760017560 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php000064400000003110150364341760016461 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressList.php000064400000017365150364341760016074 0ustar00solution = [ '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'] ); } /** * Reads AddressInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AddressInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AddressInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AddressPage Page of AddressInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AddressPage { $options = new Values($options); $params = Values::of([ 'CustomerName' => $options['customerName'], 'FriendlyName' => $options['friendlyName'], 'IsoCountry' => $options['isoCountry'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AddressPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AddressInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AddressPage Page of AddressInstance */ public function getPage(string $targetUrl): AddressPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AddressPage($this->version, $response, $this->solution); } /** * Constructs a AddressContext * * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to delete. */ public function getContext( string $sid ): AddressContext { return new AddressContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AddressList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php000064400000005523150364341760020143 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/OutgoingCallerIds.json'; } /** * Create the ValidationRequestInstance * * @param string $phoneNumber The phone number to verify in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. * @param array|Options $options Optional Arguments * @return ValidationRequestInstance Created ValidationRequestInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, array $options = []): ValidationRequestInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'FriendlyName' => $options['friendlyName'], 'CallDelay' => $options['callDelay'], 'Extension' => $options['extension'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], ]); $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyOptions.php000064400000004136150364341760015747 0ustar00options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsageList.php000064400000006736150364341760015553 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php000064400000006230150364341760017254 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SigningKeys/' . \rawurlencode($sid) .'.json'; } /** * Delete the SigningKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php000064400000012470150364341760017124 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($sid) .'.json'; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the addOnResults */ protected function getAddOnResults(): AddOnResultList { if (!$this->_addOnResults) { $this->_addOnResults = new AddOnResultList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_addOnResults; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { if (!$this->_transcriptions) { $this->_transcriptions = new TranscriptionList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_transcriptions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php000064400000005224150364341760020772 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenList.php000064400000004207150364341760015556 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferencePage.php000064400000003110150364341760016476 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php000064400000015662150364341760021124 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($sid) .'.json'; } /** * Delete the IncomingPhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php000064400000006712150364341760020405 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/OutgoingCallerIds/' . \rawurlencode($sid) .'.json'; } /** * Delete the OutgoingCallerIdInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationList.php000064400000014226150364341760017126 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Notifications.json'; } /** * Reads NotificationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NotificationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams NotificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NotificationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NotificationPage Page of NotificationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NotificationPage { $options = new Values($options); $params = Values::of([ 'Log' => $options['log'], 'MessageDate<' => Serialize::iso8601Date($options['messageDateBefore']), 'MessageDate' => Serialize::iso8601Date($options['messageDate']), 'MessageDate>' => Serialize::iso8601Date($options['messageDateAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NotificationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NotificationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NotificationPage Page of NotificationInstance */ public function getPage(string $targetUrl): NotificationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NotificationPage($this->version, $response, $this->solution); } /** * Constructs a NotificationContext * * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. */ public function getContext( string $sid ): NotificationContext { return new NotificationContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NotificationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php000064400000004660150364341760021303 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php000064400000016342150364341760022621 0ustar00solution = [ '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 voip */ protected function getVoip(): VoipList { if (!$this->_voip) { $this->_voip = new VoipList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_voip; } /** * Access the national */ protected function getNational(): NationalList { if (!$this->_national) { $this->_national = new NationalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_national; } /** * Access the mobile */ protected function getMobile(): MobileList { if (!$this->_mobile) { $this->_mobile = new MobileList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_mobile; } /** * Access the machineToMachine */ protected function getMachineToMachine(): MachineToMachineList { if (!$this->_machineToMachine) { $this->_machineToMachine = new MachineToMachineList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_machineToMachine; } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_tollFree; } /** * Access the sharedCost */ protected function getSharedCost(): SharedCostList { if (!$this->_sharedCost) { $this->_sharedCost = new SharedCostList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_sharedCost; } /** * Access the local */ protected function getLocal(): LocalList { if (!$this->_local) { $this->_local = new LocalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_local; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AvailablePhoneNumberCountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppList.php000064400000012757150364341760016541 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/ConnectApps.json'; } /** * Reads ConnectAppInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConnectAppInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ConnectAppInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConnectAppInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConnectAppPage Page of ConnectAppInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConnectAppPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConnectAppPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConnectAppInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConnectAppPage Page of ConnectAppInstance */ public function getPage(string $targetUrl): ConnectAppPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConnectAppPage($this->version, $response, $this->solution); } /** * Constructs a ConnectAppContext * * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. */ public function getContext( string $sid ): ConnectAppContext { return new ConnectAppContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ConnectAppList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyPage.php000064400000003060150364341760015635 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalancePage.php000064400000003066150364341760015766 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceList.php000064400000014741150364341760016551 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences.json'; } /** * Reads ConferenceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConferenceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ConferenceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConferenceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConferencePage Page of ConferenceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConferencePage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'DateUpdated<' => Serialize::iso8601Date($options['dateUpdatedBefore']), 'DateUpdated' => Serialize::iso8601Date($options['dateUpdated']), 'DateUpdated>' => Serialize::iso8601Date($options['dateUpdatedAfter']), 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConferencePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConferenceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConferencePage Page of ConferenceInstance */ public function getPage(string $targetUrl): ConferencePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConferencePage($this->version, $response, $this->solution); } /** * Constructs a ConferenceContext * * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch */ public function getContext( string $sid ): ConferenceContext { return new ConferenceContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ConferenceList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallList.php000064400000027741150364341760015361 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls.json'; } /** * Create the CallInstance * * @param string $to The phone number, SIP address, or client identifier to call. * @param string $from The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number. * @param array|Options $options Optional Arguments * @return CallInstance Created CallInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $from, array $options = []): CallInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'From' => $from, 'Method' => $options['method'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function ($e) { return $e; }), 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'SendDigits' => $options['sendDigits'], 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'MachineDetection' => $options['machineDetection'], 'MachineDetectionTimeout' => $options['machineDetectionTimeout'], 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), 'Trim' => $options['trim'], 'CallerId' => $options['callerId'], 'MachineDetectionSpeechThreshold' => $options['machineDetectionSpeechThreshold'], 'MachineDetectionSpeechEndThreshold' => $options['machineDetectionSpeechEndThreshold'], 'MachineDetectionSilenceTimeout' => $options['machineDetectionSilenceTimeout'], 'AsyncAmd' => $options['asyncAmd'], 'AsyncAmdStatusCallback' => $options['asyncAmdStatusCallback'], 'AsyncAmdStatusCallbackMethod' => $options['asyncAmdStatusCallbackMethod'], 'Byoc' => $options['byoc'], 'CallReason' => $options['callReason'], 'CallToken' => $options['callToken'], 'RecordingTrack' => $options['recordingTrack'], 'TimeLimit' => $options['timeLimit'], 'Url' => $options['url'], 'Twiml' => $options['twiml'], 'ApplicationSid' => $options['applicationSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CallInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads CallInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CallInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CallInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CallInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CallPage Page of CallInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CallPage { $options = new Values($options); $params = Values::of([ 'To' => $options['to'], 'From' => $options['from'], 'ParentCallSid' => $options['parentCallSid'], 'Status' => $options['status'], 'StartTime<' => Serialize::iso8601DateTime($options['startTimeBefore']), 'StartTime' => Serialize::iso8601DateTime($options['startTime']), 'StartTime>' => Serialize::iso8601DateTime($options['startTimeAfter']), 'EndTime<' => Serialize::iso8601DateTime($options['endTimeBefore']), 'EndTime' => Serialize::iso8601DateTime($options['endTime']), 'EndTime>' => Serialize::iso8601DateTime($options['endTimeAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CallPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CallInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CallPage Page of CallInstance */ public function getPage(string $targetUrl): CallPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CallPage($this->version, $response, $this->solution); } /** * Constructs a CallContext * * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete */ public function getContext( string $sid ): CallContext { return new CallContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Access the feedbackSummaries */ protected function getFeedbackSummaries(): FeedbackSummaryList { if (!$this->_feedbackSummaries) { $this->_feedbackSummaries = new FeedbackSummaryList( $this->version, $this->solution['accountSid'] ); } return $this->_feedbackSummaries; } /** * 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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php000064400000010453150364341760020411 0ustar00options['phoneNumber'] = $phoneNumber; $this->options['friendlyName'] = $friendlyName; } /** * The phone number of the OutgoingCallerId resources to read. * * @param string $phoneNumber The phone number of the OutgoingCallerId resources to read. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The string that identifies the OutgoingCallerId resources to read. * * @param string $friendlyName The string that identifies the OutgoingCallerId resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadOutgoingCallerIdOptions ' . $options . ']'; } } class UpdateOutgoingCallerIdOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateOutgoingCallerIdOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php000064400000011701150364341760020163 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'duration' => Values::array_get($payload, 'duration'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'recordingSid' => Values::array_get($payload, 'recording_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'transcriptionText' => Values::array_get($payload, 'transcription_text'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TranscriptionContext Context for this TranscriptionInstance */ protected function proxy(): TranscriptionContext { if (!$this->context) { $this->context = new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationList.php000064400000017422150364341760016744 0ustar00solution = [ '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'] ); } /** * Reads ApplicationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ApplicationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ApplicationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ApplicationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ApplicationPage Page of ApplicationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ApplicationPage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ApplicationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ApplicationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ApplicationPage Page of ApplicationInstance */ public function getPage(string $targetUrl): ApplicationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ApplicationPage($this->version, $response, $this->solution); } /** * Constructs a ApplicationContext * * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to delete. */ public function getContext( string $sid ): ApplicationContext { return new ApplicationContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ApplicationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressPage.php000064400000003066150364341760016026 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php000064400000003400150364341760017257 0ustar00options['friendlyName'] = $friendlyName; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateSigningKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingOptions.php000064400000030502150364341760017127 0ustar00=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * @return ReadRecordingOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null, string $callSid = Values::NONE, string $conferenceSid = Values::NONE, bool $includeSoftDeleted = Values::BOOL_NONE ): ReadRecordingOptions { return new ReadRecordingOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter, $callSid, $conferenceSid, $includeSoftDeleted ); } } class FetchRecordingOptions extends Options { /** * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. */ public function __construct( bool $includeSoftDeleted = Values::BOOL_NONE ) { $this->options['includeSoftDeleted'] = $includeSoftDeleted; } /** * A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * @return $this Fluent Builder */ public function setIncludeSoftDeleted(bool $includeSoftDeleted): self { $this->options['includeSoftDeleted'] = $includeSoftDeleted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.FetchRecordingOptions ' . $options . ']'; } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null, string $callSid = Values::NONE, string $conferenceSid = Values::NONE, bool $includeSoftDeleted = Values::BOOL_NONE ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['callSid'] = $callSid; $this->options['conferenceSid'] = $conferenceSid; $this->options['includeSoftDeleted'] = $includeSoftDeleted; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * @return $this Fluent Builder */ public function setCallSid(string $callSid): self { $this->options['callSid'] = $callSid; return $this; } /** * The Conference SID that identifies the conference associated with the recording to read. * * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. * @return $this Fluent Builder */ public function setConferenceSid(string $conferenceSid): self { $this->options['conferenceSid'] = $conferenceSid; return $this; } /** * A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * @return $this Fluent Builder */ public function setIncludeSoftDeleted(bool $includeSoftDeleted): self { $this->options['includeSoftDeleted'] = $includeSoftDeleted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php000064400000011120150364341760017442 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyList.php000064400000012530150364341760015224 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Keys.json'; } /** * Reads KeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return KeyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams KeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of KeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return KeyPage Page of KeyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): KeyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new KeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of KeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return KeyPage Page of KeyInstance */ public function getPage(string $targetUrl): KeyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new KeyPage($this->version, $response, $this->solution); } /** * Constructs a KeyContext * * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to delete. */ public function getContext( string $sid ): KeyContext { return new KeyContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.KeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessagePage.php000064400000003066150364341760016025 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php000064400000011710150364341760017216 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php000064400000003176150364341760020351 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallOptions.php000064400000225005150364341760016072 0ustar00=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in 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. 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 $endTimeBefore 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. 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. 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. * @return ReadCallOptions Options builder */ public static function read( string $to = Values::NONE, string $from = Values::NONE, string $parentCallSid = Values::NONE, string $status = Values::NONE, string $startTimeBefore = null, string $startTime = null, string $startTimeAfter = null, string $endTimeBefore = null, string $endTime = null, string $endTimeAfter = null ): ReadCallOptions { return new ReadCallOptions( $to, $from, $parentCallSid, $status, $startTimeBefore, $startTime, $startTimeAfter, $endTimeBefore, $endTime, $endTimeAfter ); } /** * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $status * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return UpdateCallOptions Options builder */ public static function update( string $url = Values::NONE, string $method = Values::NONE, string $status = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $twiml = Values::NONE, int $timeLimit = Values::INT_NONE ): UpdateCallOptions { return new UpdateCallOptions( $url, $method, $status, $fallbackUrl, $fallbackMethod, $statusCallback, $statusCallbackMethod, $twiml, $timeLimit ); } } class CreateCallOptions extends Options { /** * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. */ public function __construct( string $url = Values::NONE, string $twiml = Values::NONE, string $applicationSid = Values::NONE, string $method = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, string $statusCallbackMethod = Values::NONE, string $sendDigits = Values::NONE, int $timeout = Values::INT_NONE, bool $record = Values::BOOL_NONE, string $recordingChannels = Values::NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, string $machineDetection = Values::NONE, int $machineDetectionTimeout = Values::INT_NONE, array $recordingStatusCallbackEvent = Values::ARRAY_NONE, string $trim = Values::NONE, string $callerId = Values::NONE, int $machineDetectionSpeechThreshold = Values::INT_NONE, int $machineDetectionSpeechEndThreshold = Values::INT_NONE, int $machineDetectionSilenceTimeout = Values::INT_NONE, string $asyncAmd = Values::NONE, string $asyncAmdStatusCallback = Values::NONE, string $asyncAmdStatusCallbackMethod = Values::NONE, string $byoc = Values::NONE, string $callReason = Values::NONE, string $callToken = Values::NONE, string $recordingTrack = Values::NONE, int $timeLimit = Values::INT_NONE ) { $this->options['url'] = $url; $this->options['twiml'] = $twiml; $this->options['applicationSid'] = $applicationSid; $this->options['method'] = $method; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['sendDigits'] = $sendDigits; $this->options['timeout'] = $timeout; $this->options['record'] = $record; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['machineDetection'] = $machineDetection; $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['trim'] = $trim; $this->options['callerId'] = $callerId; $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; $this->options['asyncAmd'] = $asyncAmd; $this->options['asyncAmdStatusCallback'] = $asyncAmdStatusCallback; $this->options['asyncAmdStatusCallbackMethod'] = $asyncAmdStatusCallbackMethod; $this->options['byoc'] = $byoc; $this->options['callReason'] = $callReason; $this->options['callToken'] = $callToken; $this->options['recordingTrack'] = $recordingTrack; $this->options['timeLimit'] = $timeLimit; } /** * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @return $this Fluent Builder */ public function setUrl(string $url): self { $this->options['url'] = $url; return $this; } /** * TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. * * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. * @return $this Fluent Builder */ public function setTwiml(string $twiml): self { $this->options['twiml'] = $twiml; return $this; } /** * The SID of the Application resource that will handle the call, if the call will be handled by an application. * * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. * @return $this Fluent Builder */ public function setApplicationSid(string $applicationSid): self { $this->options['applicationSid'] = $applicationSid; return $this; } /** * The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setFallbackMethod(string $fallbackMethod): self { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. * * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. * @return $this Fluent Builder */ public function setStatusCallbackEvent(array $statusCallbackEvent): self { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. * * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. * @return $this Fluent Builder */ public function setSendDigits(string $sendDigits): self { $this->options['sendDigits'] = $sendDigits; return $this; } /** * The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. * * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. * * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. * @return $this Fluent Builder */ public function setRecord(bool $record): self { $this->options['record'] = $record; return $this; } /** * The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. * * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. * @return $this Fluent Builder */ public function setRecordingChannels(string $recordingChannels): self { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we call when the recording is available to be accessed. * * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. * @return $this Fluent Builder */ public function setRecordingStatusCallback(string $recordingStatusCallback): self { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The username used to authenticate the caller making a SIP call. * * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. * @return $this Fluent Builder */ public function setSipAuthUsername(string $sipAuthUsername): self { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The password required to authenticate the user account specified in `sip_auth_username`. * * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. * @return $this Fluent Builder */ public function setSipAuthPassword(string $sipAuthPassword): self { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @return $this Fluent Builder */ public function setMachineDetection(string $machineDetection): self { $this->options['machineDetection'] = $machineDetection; return $this; } /** * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @return $this Fluent Builder */ public function setMachineDetectionTimeout(int $machineDetectionTimeout): self { $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; return $this; } /** * The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. * * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @return $this Fluent Builder */ public function setTrim(string $trim): self { $this->options['trim'] = $trim; return $this; } /** * The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. * * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. * @return $this Fluent Builder */ public function setCallerId(string $callerId): self { $this->options['callerId'] = $callerId; return $this; } /** * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @return $this Fluent Builder */ public function setMachineDetectionSpeechThreshold(int $machineDetectionSpeechThreshold): self { $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; return $this; } /** * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @return $this Fluent Builder */ public function setMachineDetectionSpeechEndThreshold(int $machineDetectionSpeechEndThreshold): self { $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; return $this; } /** * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @return $this Fluent Builder */ public function setMachineDetectionSilenceTimeout(int $machineDetectionSilenceTimeout): self { $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; return $this; } /** * Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. * * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setAsyncAmd(string $asyncAmd): self { $this->options['asyncAmd'] = $asyncAmd; return $this; } /** * The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @return $this Fluent Builder */ public function setAsyncAmdStatusCallback(string $asyncAmdStatusCallback): self { $this->options['asyncAmdStatusCallback'] = $asyncAmdStatusCallback; return $this; } /** * The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setAsyncAmdStatusCallbackMethod(string $asyncAmdStatusCallbackMethod): self { $this->options['asyncAmdStatusCallbackMethod'] = $asyncAmdStatusCallbackMethod; return $this; } /** * The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @return $this Fluent Builder */ public function setByoc(string $byoc): self { $this->options['byoc'] = $byoc; return $this; } /** * The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @return $this Fluent Builder */ public function setCallReason(string $callReason): self { $this->options['callReason'] = $callReason; return $this; } /** * A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * @return $this Fluent Builder */ public function setCallToken(string $callToken): self { $this->options['callToken'] = $callToken; return $this; } /** * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * @return $this Fluent Builder */ public function setRecordingTrack(string $recordingTrack): self { $this->options['recordingTrack'] = $recordingTrack; return $this; } /** * The maximum duration of the call in seconds. Constraints depend on account and configuration. * * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return $this Fluent Builder */ public function setTimeLimit(int $timeLimit): self { $this->options['timeLimit'] = $timeLimit; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateCallOptions ' . $options . ']'; } } class ReadCallOptions extends Options { /** * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. * @param string $parentCallSid Only include calls spawned by calls with this SID. * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in 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. 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. 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 $endTimeBefore 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. 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. 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. */ public function __construct( string $to = Values::NONE, string $from = Values::NONE, string $parentCallSid = Values::NONE, string $status = Values::NONE, string $startTimeBefore = null, string $startTime = null, string $startTimeAfter = null, string $endTimeBefore = null, string $endTime = null, string $endTimeAfter = null ) { $this->options['to'] = $to; $this->options['from'] = $from; $this->options['parentCallSid'] = $parentCallSid; $this->options['status'] = $status; $this->options['startTimeBefore'] = $startTimeBefore; $this->options['startTime'] = $startTime; $this->options['startTimeAfter'] = $startTimeAfter; $this->options['endTimeBefore'] = $endTimeBefore; $this->options['endTime'] = $endTime; $this->options['endTimeAfter'] = $endTimeAfter; } /** * Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * Only include calls from this phone number, SIP address, Client identifier or SIM SID. * * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * Only include calls spawned by calls with this SID. * * @param string $parentCallSid Only include calls spawned by calls with this SID. * @return $this Fluent Builder */ public function setParentCallSid(string $parentCallSid): self { $this->options['parentCallSid'] = $parentCallSid; return $this; } /** * The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. * * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in 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. 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. * @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. 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. * @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. 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. * @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. 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. * @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. 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. * @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. 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. * @return $this Fluent Builder */ public function setEndTimeAfter(string $endTimeAfter): self { $this->options['endTimeAfter'] = $endTimeAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadCallOptions ' . $options . ']'; } } class UpdateCallOptions extends Options { /** * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $status * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. */ public function __construct( string $url = Values::NONE, string $method = Values::NONE, string $status = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $twiml = Values::NONE, int $timeLimit = Values::INT_NONE ) { $this->options['url'] = $url; $this->options['method'] = $method; $this->options['status'] = $status; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['twiml'] = $twiml; $this->options['timeLimit'] = $timeLimit; } /** * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @return $this Fluent Builder */ public function setUrl(string $url): self { $this->options['url'] = $url; return $this; } /** * The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setFallbackMethod(string $fallbackMethod): self { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * @return $this Fluent Builder */ public function setTwiml(string $twiml): self { $this->options['twiml'] = $twiml; return $this; } /** * The maximum duration of the call in seconds. Constraints depend on account and configuration. * * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return $this Fluent Builder */ public function setTimeLimit(int $timeLimit): self { $this->options['timeLimit'] = $timeLimit; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateCallOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php000064400000011444150364341760020523 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return OutgoingCallerIdContext Context for this OutgoingCallerIdInstance */ protected function proxy(): OutgoingCallerIdContext { if (!$this->context) { $this->context = new OutgoingCallerIdContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the OutgoingCallerIdInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the OutgoingCallerIdInstance * * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OutgoingCallerIdInstance { return $this->proxy()->fetch(); } /** * Update the OutgoingCallerIdInstance * * @param array|Options $options Optional Arguments * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): OutgoingCallerIdInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.OutgoingCallerIdInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php000064400000014105150364341760022265 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php000064400000014116150364341760022751 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreeInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php000064400000020344150364341760021613 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/Mobile.json'; } /** * Create the MobileInstance * * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @param array|Options $options Optional Arguments * @return MobileInstance Created MobileInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, array $options = []): MobileInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MobileInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads MobileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MobileInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MobileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MobileInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MobilePage Page of MobileInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MobilePage { $options = new Values($options); $params = Values::of([ 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MobilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MobileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MobilePage Page of MobileInstance */ public function getPage(string $targetUrl): MobilePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MobilePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobileList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php000064400000003144150364341760022060 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php000064400000020420150364341760022113 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/TollFree.json'; } /** * Create the TollFreeInstance * * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @param array|Options $options Optional Arguments * @return TollFreeInstance Created TollFreeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, array $options = []): TollFreeInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TollFreeInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads TollFreeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TollFreeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TollFreeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TollFreeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TollFreePage Page of TollFreeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TollFreePage { $options = new Values($options); $params = Values::of([ 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TollFreePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TollFreeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TollFreePage Page of TollFreeInstance */ public function getPage(string $targetUrl): TollFreePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TollFreePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php000064400000012371150364341760023701 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'description' => Values::array_get($payload, 'description'), 'configuration' => Values::array_get($payload, 'configuration'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssignedAddOnContext Context for this AssignedAddOnInstance */ protected function proxy(): AssignedAddOnContext { if (!$this->context) { $this->context = new AssignedAddOnContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AssignedAddOnInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AssignedAddOnInstance * * @return AssignedAddOnInstance Fetched AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssignedAddOnInstance { return $this->proxy()->fetch(); } /** * Access the extensions */ protected function getExtensions(): AssignedAddOnExtensionList { return $this->proxy()->extensions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php000064400000003242150364341760023006 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php000064400000066623150364341760022170 0ustar00options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateLocalOptions ' . $options . ']'; } } class ReadLocalOptions extends Options { /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ public function __construct( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin(string $origin): self { $this->options['origin'] = $origin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php000064400000015117150364341760023051 0ustar00solution = [ 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) .'/AssignedAddOns.json'; } /** * Create the AssignedAddOnInstance * * @param string $installedAddOnSid The SID that identifies the Add-on installation. * @return AssignedAddOnInstance Created AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $installedAddOnSid): AssignedAddOnInstance { $data = Values::of([ 'InstalledAddOnSid' => $installedAddOnSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AssignedAddOnInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'] ); } /** * Reads AssignedAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssignedAddOnInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AssignedAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssignedAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssignedAddOnPage Page of AssignedAddOnInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssignedAddOnPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssignedAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssignedAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssignedAddOnPage Page of AssignedAddOnInstance */ public function getPage(string $targetUrl): AssignedAddOnPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssignedAddOnPage($this->version, $response, $this->solution); } /** * Constructs a AssignedAddOnContext * * @param string $sid The Twilio-provided string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): AssignedAddOnContext { return new AssignedAddOnContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AssignedAddOnList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php000064400000066574150364341760022657 0ustar00options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateTollFreeOptions ' . $options . ']'; } } class ReadTollFreeOptions extends Options { /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ public function __construct( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin(string $origin): self { $this->options['origin'] = $origin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']'; } } Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php000064400000005762150364341760030050 0ustar00sdk/srcsolution = [ '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) . ']'; } } src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php000064400000003431150364341760027267 0ustar00sdksolution = $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]'; } } src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php000064400000014504150364341760027331 0ustar00sdksolution = [ 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) .'/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) .'/Extensions.json'; } /** * Reads AssignedAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssignedAddOnExtensionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AssignedAddOnExtensionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssignedAddOnExtensionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssignedAddOnExtensionPage Page of AssignedAddOnExtensionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssignedAddOnExtensionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssignedAddOnExtensionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssignedAddOnExtensionPage Page of AssignedAddOnExtensionInstance */ public function getPage(string $targetUrl): AssignedAddOnExtensionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a AssignedAddOnExtensionContext * * @param string $sid The Twilio-provided string that uniquely identifies the resource to fetch. */ public function getContext( string $sid ): AssignedAddOnExtensionContext { return new AssignedAddOnExtensionContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AssignedAddOnExtensionList]'; } } Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php000064400000011356150364341760030164 0ustar00sdk/srcproperties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php000064400000066612150364341760022343 0ustar00options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateMobileOptions ' . $options . ']'; } } class ReadMobileOptions extends Options { /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ public function __construct( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin(string $origin): self { $this->options['origin'] = $origin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php000064400000014110150364341760022436 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobileInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php000064400000003130150364341760021546 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php000064400000003122150364341760021372 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php000064400000020316150364341760021435 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/Local.json'; } /** * Create the LocalInstance * * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @param array|Options $options Optional Arguments * @return LocalInstance Created LocalInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, array $options = []): LocalInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new LocalInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads LocalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LocalInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams LocalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LocalInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LocalPage Page of LocalInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LocalPage { $options = new Values($options); $params = Values::of([ 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LocalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LocalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LocalPage Page of LocalInstance */ public function getPage(string $targetUrl): LocalPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LocalPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php000064400000011411150364341760023553 0ustar00solution = [ 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) .'/AssignedAddOns/' . \rawurlencode($sid) .'.json'; } /** * Delete the AssignedAddOnInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php000064400000020062150364341760017245 0ustar00options['authorizeRedirectUrl'] = $authorizeRedirectUrl; $this->options['companyName'] = $companyName; $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; $this->options['description'] = $description; $this->options['friendlyName'] = $friendlyName; $this->options['homepageUrl'] = $homepageUrl; $this->options['permissions'] = $permissions; } /** * The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. * * @param string $authorizeRedirectUrl The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. * @return $this Fluent Builder */ public function setAuthorizeRedirectUrl(string $authorizeRedirectUrl): self { $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; return $this; } /** * The company name to set for the Connect App. * * @param string $companyName The company name to set for the Connect App. * @return $this Fluent Builder */ public function setCompanyName(string $companyName): self { $this->options['companyName'] = $companyName; return $this; } /** * The HTTP method to use when calling `deauthorize_callback_url`. * * @param string $deauthorizeCallbackMethod The HTTP method to use when calling `deauthorize_callback_url`. * @return $this Fluent Builder */ public function setDeauthorizeCallbackMethod(string $deauthorizeCallbackMethod): self { $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; return $this; } /** * The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. * * @param string $deauthorizeCallbackUrl The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. * @return $this Fluent Builder */ public function setDeauthorizeCallbackUrl(string $deauthorizeCallbackUrl): self { $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; return $this; } /** * A description of the Connect App. * * @param string $description A description of the Connect App. * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A public URL where users can obtain more information about this Connect App. * * @param string $homepageUrl A public URL where users can obtain more information about this Connect App. * @return $this Fluent Builder */ public function setHomepageUrl(string $homepageUrl): self { $this->options['homepageUrl'] = $homepageUrl; return $this; } /** * A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. * * @param string $permissions A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. * @return $this Fluent Builder */ public function setPermissions(array $permissions): self { $this->options['permissions'] = $permissions; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateConnectAppOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php000064400000007434150364341760023775 0ustar00properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php000064400000007445150364341760024461 0ustar00properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreeInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php000064400000016200150364341760023310 0ustar00solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/Mobile.json'; } /** * Reads MobileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MobileInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MobileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MobileInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MobilePage Page of MobileInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MobilePage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MobilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MobileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MobilePage Page of MobileInstance */ public function getPage(string $targetUrl): MobilePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MobilePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobileList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php000064400000007431150364341760023655 0ustar00properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.VoipInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php000064400000007475150364341760026104 0ustar00properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MachineToMachineInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php000064400000016242150364341760023654 0ustar00solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/National.json'; } /** * Reads NationalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NationalInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams NationalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NationalInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NationalPage Page of NationalInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NationalPage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NationalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NationalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NationalPage Page of NationalInstance */ public function getPage(string $targetUrl): NationalPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NationalPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NationalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php000064400000003224150364341760023560 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php000064400000016242150364341760023623 0ustar00solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/TollFree.json'; } /** * Reads TollFreeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TollFreeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TollFreeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TollFreeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TollFreePage Page of TollFreeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TollFreePage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TollFreePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TollFreeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TollFreePage Page of TollFreeInstance */ public function getPage(string $targetUrl): TollFreePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TollFreePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php000064400000053307150364341760023664 0ustar00options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php000064400000016136150364341760023026 0ustar00solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/Voip.json'; } /** * Reads VoipInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return VoipInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams VoipInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of VoipInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return VoipPage Page of VoipInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): VoipPage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new VoipPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of VoipInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return VoipPage Page of VoipInstance */ public function getPage(string $targetUrl): VoipPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new VoipPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.VoipList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php000064400000003240150364341760024101 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php000064400000052655150364341760023554 0ustar00options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadVoipOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php000064400000052705150364341760024347 0ustar00options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php000064400000007453150364341760025003 0ustar00properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SharedCostInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php000064400000016452150364341760025246 0ustar00solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/MachineToMachine.json'; } /** * Reads MachineToMachineInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MachineToMachineInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MachineToMachineInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MachineToMachineInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MachineToMachinePage Page of MachineToMachineInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MachineToMachinePage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MachineToMachinePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MachineToMachineInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MachineToMachinePage Page of MachineToMachineInstance */ public function getPage(string $targetUrl): MachineToMachinePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MachineToMachinePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MachineToMachineList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php000064400000007445150364341760024512 0ustar00properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NationalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php000064400000003174150364341760022765 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php000064400000052705150364341760024400 0ustar00options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadNationalOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php000064400000003304150364341760025177 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php000064400000052671150364341760024044 0ustar00options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php000064400000007437150364341760024155 0ustar00properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobileInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php000064400000003224150364341760023611 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php000064400000016304150364341760024145 0ustar00solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/SharedCost.json'; } /** * Reads SharedCostInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SharedCostInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SharedCostInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SharedCostInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SharedCostPage Page of SharedCostInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SharedCostPage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SharedCostPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SharedCostInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SharedCostPage Page of SharedCostInstance */ public function getPage(string $targetUrl): SharedCostPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SharedCostPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SharedCostList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php000064400000052765150364341760025775 0ustar00options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMachineToMachineOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php000064400000003210150364341760023246 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php000064400000003202150364341760023072 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php000064400000016157150364341760023146 0ustar00solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/Local.json'; } /** * Reads LocalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LocalInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams LocalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LocalInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LocalPage Page of LocalInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LocalPage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LocalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LocalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LocalPage Page of LocalInstance */ public function getPage(string $targetUrl): LocalPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LocalPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php000064400000052721150364341760024670 0ustar00options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadSharedCostOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php000064400000011000150364341760017607 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php000064400000006675150364341760017515 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php000064400000003131150364341760016725 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php000064400000013276150364341760016777 0ustar00solution = [ 'accountSid' => $accountSid, 'queueSid' => $queueSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Queues/' . \rawurlencode($queueSid) .'/Members.json'; } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to fetch. */ public function getContext( string $callSid ): MemberContext { return new MemberContext( $this->version, $this->solution['accountSid'], $this->solution['queueSid'], $callSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MemberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php000064400000004540150364341760017511 0ustar00options['method'] = $method; } /** * How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. * * @param string $method How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueList.php000064400000014434150364341760015565 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Queues.json'; } /** * Create the QueueInstance * * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. * @param array|Options $options Optional Arguments * @return QueueInstance Created QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): QueueInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'MaxSize' => $options['maxSize'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new QueueInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads QueueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return QueueInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams QueueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of QueueInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return QueuePage Page of QueueInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): QueuePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new QueuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of QueueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return QueuePage Page of QueueInstance */ public function getPage(string $targetUrl): QueuePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new QueuePage($this->version, $response, $this->solution); } /** * Constructs a QueueContext * * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to delete */ public function getContext( string $sid ): QueueContext { return new QueueContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.QueueList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php000064400000020445150364341760021237 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IncomingPhoneNumberContext Context for this IncomingPhoneNumberInstance */ protected function proxy(): IncomingPhoneNumberContext { if (!$this->context) { $this->context = new IncomingPhoneNumberContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IncomingPhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IncomingPhoneNumberInstance * * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IncomingPhoneNumberInstance { return $this->proxy()->fetch(); } /** * Update the IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IncomingPhoneNumberInstance { return $this->proxy()->update($options); } /** * Access the assignedAddOns */ protected function getAssignedAddOns(): AssignedAddOnList { return $this->proxy()->assignedAddOns; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IncomingPhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueuePage.php000064400000003052150364341760015520 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationInstance.php000064400000012241150364341760017752 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalanceList.php000064400000003522150364341760016022 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingPage.php000064400000003102150364341760016344 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageContext.php000064400000012665150364341760016602 0ustar00solution = [ '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 feedback */ protected function getFeedback(): FeedbackList { if (!$this->_feedback) { $this->_feedback = new FeedbackList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_feedback; } /** * Access the media */ protected function getMedia(): MediaList { if (!$this->_media) { $this->_media = new MediaList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_media; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipPage.php000064400000003036150364341760015171 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressInstance.php000064400000013571150364341760016720 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallPage.php000064400000003044150364341760015310 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php000064400000021463150364341760017113 0ustar00options['friendlyName'] = $friendlyName; $this->options['shortCode'] = $shortCode; } /** * The string that identifies the ShortCode resources to read. * * @param string $friendlyName The string that identifies the ShortCode resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $shortCode Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setShortCode(string $shortCode): self { $this->options['shortCode'] = $shortCode; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadShortCodeOptions ' . $options . ']'; } } class UpdateShortCodeOptions extends Options { /** * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. */ public function __construct( string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['apiVersion'] = $apiVersion; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; } /** * A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. * * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. * * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when receiving an incoming SMS message to this short code. * * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateShortCodeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenInstance.php000064400000005541150364341760016411 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueInstance.php000064400000012005150364341760016406 0ustar00properties = [ 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'currentSize' => Values::array_get($payload, 'current_size'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uri' => Values::array_get($payload, 'uri'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'averageWaitTime' => Values::array_get($payload, 'average_wait_time'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'maxSize' => Values::array_get($payload, 'max_size'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return QueueContext Context for this QueueInstance */ protected function proxy(): QueueContext { if (!$this->context) { $this->context = new QueueContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the QueueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the QueueInstance * * @return QueueInstance Fetched QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): QueueInstance { return $this->proxy()->fetch(); } /** * Update the QueueInstance * * @param array|Options $options Optional Arguments * @return QueueInstance Updated QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): QueueInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.QueueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php000064400000013406150364341760022737 0ustar00properties = [ 'countryCode' => Values::array_get($payload, 'country_code'), 'country' => Values::array_get($payload, 'country'), 'uri' => Values::array_get($payload, 'uri'), 'beta' => Values::array_get($payload, 'beta'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode ?: $this->properties['countryCode'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AvailablePhoneNumberCountryContext Context for this AvailablePhoneNumberCountryInstance */ protected function proxy(): AvailablePhoneNumberCountryContext { if (!$this->context) { $this->context = new AvailablePhoneNumberCountryContext( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->context; } /** * Fetch the AvailablePhoneNumberCountryInstance * * @return AvailablePhoneNumberCountryInstance Fetched AvailablePhoneNumberCountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AvailablePhoneNumberCountryInstance { return $this->proxy()->fetch(); } /** * Access the voip */ protected function getVoip(): VoipList { return $this->proxy()->voip; } /** * Access the national */ protected function getNational(): NationalList { return $this->proxy()->national; } /** * Access the mobile */ protected function getMobile(): MobileList { return $this->proxy()->mobile; } /** * Access the machineToMachine */ protected function getMachineToMachine(): MachineToMachineList { return $this->proxy()->machineToMachine; } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { return $this->proxy()->tollFree; } /** * Access the sharedCost */ protected function getSharedCost(): SharedCostList { return $this->proxy()->sharedCost; } /** * Access the local */ protected function getLocal(): LocalList { return $this->proxy()->local; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AvailablePhoneNumberCountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php000064400000005212150364341760020043 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Transcriptions/' . \rawurlencode($sid) .'.json'; } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationPage.php000064400000003124150364341760017062 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallInstance.php000064400000021414150364341760016201 0ustar00properties = [ '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 userDefinedMessageSubscriptions */ protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList { return $this->proxy()->userDefinedMessageSubscriptions; } /** * Access the events */ protected function getEvents(): EventList { return $this->proxy()->events; } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Access the userDefinedMessages */ protected function getUserDefinedMessages(): UserDefinedMessageList { return $this->proxy()->userDefinedMessages; } /** * Access the siprec */ protected function getSiprec(): SiprecList { return $this->proxy()->siprec; } /** * Access the streams */ protected function getStreams(): StreamList { return $this->proxy()->streams; } /** * Access the payments */ protected function getPayments(): PaymentList { return $this->proxy()->payments; } /** * 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.CallInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php000064400000006625150364341760017107 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php000064400000013631150364341760022106 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers.json'; } /** * Reads AvailablePhoneNumberCountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailablePhoneNumberCountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AvailablePhoneNumberCountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AvailablePhoneNumberCountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AvailablePhoneNumberCountryPage Page of AvailablePhoneNumberCountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AvailablePhoneNumberCountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailablePhoneNumberCountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AvailablePhoneNumberCountryPage Page of AvailablePhoneNumberCountryInstance */ public function getPage(string $targetUrl): AvailablePhoneNumberCountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); } /** * Constructs a AvailablePhoneNumberCountryContext * * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. */ public function getContext( string $countryCode ): AvailablePhoneNumberCountryContext { return new AvailablePhoneNumberCountryContext( $this->version, $this->solution['accountSid'], $countryCode ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AvailablePhoneNumberCountryList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php000064400000014647150364341760017603 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php000064400000013202150364341760017771 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callbackMethod' => Values::array_get($payload, 'callback_method'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'currentValue' => Values::array_get($payload, 'current_value'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateFired' => Deserialize::dateTime(Values::array_get($payload, 'date_fired')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'recurring' => Values::array_get($payload, 'recurring'), 'sid' => Values::array_get($payload, 'sid'), 'triggerBy' => Values::array_get($payload, 'trigger_by'), 'triggerValue' => Values::array_get($payload, 'trigger_value'), 'uri' => Values::array_get($payload, 'uri'), 'usageCategory' => Values::array_get($payload, 'usage_category'), 'usageRecordUri' => Values::array_get($payload, 'usage_record_uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TriggerContext Context for this TriggerInstance */ protected function proxy(): TriggerContext { if (!$this->context) { $this->context = new TriggerContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TriggerInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TriggerInstance * * @return TriggerInstance Fetched TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TriggerInstance { return $this->proxy()->fetch(); } /** * Update the TriggerInstance * * @param array|Options $options Optional Arguments * @return TriggerInstance Updated TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TriggerInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TriggerInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php000064400000015307150364341760017503 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php000064400000024473150364341760016767 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records.json'; } /** * Reads RecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordPage Page of RecordInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordPage Page of RecordInstance */ public function getPage(string $targetUrl): RecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordPage($this->version, $response, $this->solution); } /** * Access the lastMonth */ protected function getLastMonth(): LastMonthList { if (!$this->_lastMonth) { $this->_lastMonth = new LastMonthList( $this->version, $this->solution['accountSid'] ); } return $this->_lastMonth; } /** * Access the today */ protected function getToday(): TodayList { if (!$this->_today) { $this->_today = new TodayList( $this->version, $this->solution['accountSid'] ); } return $this->_today; } /** * Access the yearly */ protected function getYearly(): YearlyList { if (!$this->_yearly) { $this->_yearly = new YearlyList( $this->version, $this->solution['accountSid'] ); } return $this->_yearly; } /** * Access the thisMonth */ protected function getThisMonth(): ThisMonthList { if (!$this->_thisMonth) { $this->_thisMonth = new ThisMonthList( $this->version, $this->solution['accountSid'] ); } return $this->_thisMonth; } /** * Access the daily */ protected function getDaily(): DailyList { if (!$this->_daily) { $this->_daily = new DailyList( $this->version, $this->solution['accountSid'] ); } return $this->_daily; } /** * Access the allTime */ protected function getAllTime(): AllTimeList { if (!$this->_allTime) { $this->_allTime = new AllTimeList( $this->version, $this->solution['accountSid'] ); } return $this->_allTime; } /** * Access the yesterday */ protected function getYesterday(): YesterdayList { if (!$this->_yesterday) { $this->_yesterday = new YesterdayList( $this->version, $this->solution['accountSid'] ); } return $this->_yesterday; } /** * Access the monthly */ protected function getMonthly(): MonthlyList { if (!$this->_monthly) { $this->_monthly = new MonthlyList( $this->version, $this->solution['accountSid'] ); } return $this->_monthly; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php000064400000016656150364341760017160 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Triggers.json'; } /** * Create the TriggerInstance * * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. * @param string $triggerValue The usage value at which the trigger should fire. For convenience, you can use an offset value such as `+30` to specify a trigger_value that is 30 units more than the current usage value. Be sure to urlencode a `+` as `%2B`. * @param string $usageCategory * @param array|Options $options Optional Arguments * @return TriggerInstance Created TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $callbackUrl, string $triggerValue, string $usageCategory, array $options = []): TriggerInstance { $options = new Values($options); $data = Values::of([ 'CallbackUrl' => $callbackUrl, 'TriggerValue' => $triggerValue, 'UsageCategory' => $usageCategory, 'CallbackMethod' => $options['callbackMethod'], 'FriendlyName' => $options['friendlyName'], 'Recurring' => $options['recurring'], 'TriggerBy' => $options['triggerBy'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TriggerInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads TriggerInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TriggerInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TriggerInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TriggerInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TriggerPage Page of TriggerInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TriggerPage { $options = new Values($options); $params = Values::of([ 'Recurring' => $options['recurring'], 'TriggerBy' => $options['triggerBy'], 'UsageCategory' => $options['usageCategory'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TriggerPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TriggerInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TriggerPage Page of TriggerInstance */ public function getPage(string $targetUrl): TriggerPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TriggerPage($this->version, $response, $this->solution); } /** * Constructs a TriggerContext * * @param string $sid The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete. */ public function getContext( string $sid ): TriggerContext { return new TriggerContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TriggerList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php000064400000007226150364341760017615 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php000064400000003074150364341760016722 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php000064400000006705150364341760017663 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Triggers/' . \rawurlencode($sid) .'.json'; } /** * Delete the TriggerInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php000064400000015316150364341760020750 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadYearlyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php000064400000015340150364341760021411 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadLastMonthOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php000064400000013232150364341760020036 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Today.json'; } /** * Reads TodayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TodayInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TodayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TodayInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TodayPage Page of TodayInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TodayPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TodayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TodayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TodayPage Page of TodayInstance */ public function getPage(string $targetUrl): TodayPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TodayPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TodayList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php000064400000015324150364341760021031 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadAllTimeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php000064400000003104150364341760017756 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php000064400000013336150364341760020734 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Yesterday.json'; } /** * Reads YesterdayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return YesterdayInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams YesterdayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of YesterdayInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return YesterdayPage Page of YesterdayInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): YesterdayPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new YesterdayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of YesterdayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return YesterdayPage Page of YesterdayInstance */ public function getPage(string $targetUrl): YesterdayPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new YesterdayPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.YesterdayList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php000064400000013336150364341760020700 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/ThisMonth.json'; } /** * Reads ThisMonthInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ThisMonthInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ThisMonthInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ThisMonthInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ThisMonthPage Page of ThisMonthInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ThisMonthPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ThisMonthPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ThisMonthInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ThisMonthPage Page of ThisMonthInstance */ public function getPage(string $targetUrl): ThisMonthPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ThisMonthPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ThisMonthList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php000064400000007240150364341760021140 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php000064400000007232150364341760020672 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php000064400000013274150364341760020313 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/AllTime.json'; } /** * Reads AllTimeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AllTimeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AllTimeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AllTimeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AllTimePage Page of AllTimeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AllTimePage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AllTimePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AllTimeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AllTimePage Page of AllTimeInstance */ public function getPage(string $targetUrl): AllTimePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AllTimePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AllTimeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php000064400000007246150364341760021530 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php000064400000013274150364341760020416 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Monthly.json'; } /** * Reads MonthlyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MonthlyInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MonthlyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MonthlyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MonthlyPage Page of MonthlyInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MonthlyPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MonthlyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MonthlyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MonthlyPage Page of MonthlyInstance */ public function getPage(string $targetUrl): MonthlyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MonthlyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MonthlyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php000064400000013253150364341760020226 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Yearly.json'; } /** * Reads YearlyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return YearlyInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams YearlyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of YearlyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return YearlyPage Page of YearlyInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): YearlyPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new YearlyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of YearlyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return YearlyPage Page of YearlyInstance */ public function getPage(string $targetUrl): YearlyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new YearlyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.YearlyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php000064400000003134150364341760020670 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php000064400000003120150364341760020241 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php000064400000015310150364341760020555 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadTodayOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php000064400000003104150364341760017774 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php000064400000013336150364341760020674 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/LastMonth.json'; } /** * Reads LastMonthInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LastMonthInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams LastMonthInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LastMonthInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LastMonthPage Page of LastMonthInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LastMonthPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LastMonthPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LastMonthInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LastMonthPage Page of LastMonthInstance */ public function getPage(string $targetUrl): LastMonthPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LastMonthPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LastMonthList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php000064400000003134150364341760020630 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php000064400000003112150364341760020160 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php000064400000015324150364341760021134 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMonthlyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php000064400000007246150364341760021570 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php000064400000003134150364341760020634 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php000064400000007240150364341760021243 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php000064400000007235150364341760021062 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php000064400000003120150364341760020344 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php000064400000007246150364341760021534 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php000064400000013232150364341760020020 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Daily.json'; } /** * Reads DailyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DailyInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams DailyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DailyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DailyPage Page of DailyInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DailyPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DailyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DailyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DailyPage Page of DailyInstance */ public function getPage(string $targetUrl): DailyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DailyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DailyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php000064400000015340150364341760021415 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadThisMonthOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php000064400000007232150364341760020654 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php000064400000015310150364341760020537 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadDailyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php000064400000015340150364341760021451 0ustar00options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadYesterdayOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php000064400000026505150364341760017672 0ustar00options['callbackMethod'] = $callbackMethod; $this->options['friendlyName'] = $friendlyName; $this->options['recurring'] = $recurring; $this->options['triggerBy'] = $triggerBy; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * @param string $recurring * @return $this Fluent Builder */ public function setRecurring(string $recurring): self { $this->options['recurring'] = $recurring; return $this; } /** * @param string $triggerBy * @return $this Fluent Builder */ public function setTriggerBy(string $triggerBy): self { $this->options['triggerBy'] = $triggerBy; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateTriggerOptions ' . $options . ']'; } } class ReadTriggerOptions extends Options { /** * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). */ public function __construct( string $recurring = Values::NONE, string $triggerBy = Values::NONE, string $usageCategory = Values::NONE ) { $this->options['recurring'] = $recurring; $this->options['triggerBy'] = $triggerBy; $this->options['usageCategory'] = $usageCategory; } /** * The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. * * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. * @return $this Fluent Builder */ public function setRecurring(string $recurring): self { $this->options['recurring'] = $recurring; return $this; } /** * The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). * * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). * @return $this Fluent Builder */ public function setTriggerBy(string $triggerBy): self { $this->options['triggerBy'] = $triggerBy; return $this; } /** * The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). * * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). * @return $this Fluent Builder */ public function setUsageCategory(string $usageCategory): self { $this->options['usageCategory'] = $usageCategory; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadTriggerOptions ' . $options . ']'; } } class UpdateTriggerOptions extends Options { /** * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we should call using `callback_method` when the trigger fires. * * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateTriggerOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php000064400000003102150364341760017077 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressContext.php000064400000013265150364341760016600 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php000064400000014014150364341760017666 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/OutgoingCallerIds.json'; } /** * Reads OutgoingCallerIdInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return OutgoingCallerIdInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams OutgoingCallerIdInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of OutgoingCallerIdInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return OutgoingCallerIdPage Page of OutgoingCallerIdInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): OutgoingCallerIdPage { $options = new Values($options); $params = Values::of([ 'PhoneNumber' => $options['phoneNumber'], 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new OutgoingCallerIdPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of OutgoingCallerIdInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return OutgoingCallerIdPage Page of OutgoingCallerIdInstance */ public function getPage(string $targetUrl): OutgoingCallerIdPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new OutgoingCallerIdPage($this->version, $response, $this->solution); } /** * Constructs a OutgoingCallerIdContext * * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to delete. */ public function getContext( string $sid ): OutgoingCallerIdContext { return new OutgoingCallerIdContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.OutgoingCallerIdList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php000064400000003204150364341760020524 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyList.php000064400000012446150364341760016551 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SigningKeys.json'; } /** * Reads SigningKeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SigningKeyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SigningKeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SigningKeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SigningKeyPage Page of SigningKeyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SigningKeyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SigningKeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SigningKeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SigningKeyPage Page of SigningKeyInstance */ public function getPage(string $targetUrl): SigningKeyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SigningKeyPage($this->version, $response, $this->solution); } /** * Constructs a SigningKeyContext * * @param string $sid */ public function getContext( string $sid ): SigningKeyContext { return new SigningKeyContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SigningKeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php000064400000036415150364341760017273 0ustar00=YYYY-MM-DD`. * @param string $dateCreated 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 `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 $dateUpdatedBefore 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 `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 `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 $friendlyName The string that identifies the Conference resources to read. * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. * @return ReadConferenceOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null, string $dateUpdatedBefore = null, string $dateUpdated = null, string $dateUpdatedAfter = null, string $friendlyName = Values::NONE, string $status = Values::NONE ): ReadConferenceOptions { return new ReadConferenceOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter, $dateUpdatedBefore, $dateUpdated, $dateUpdatedAfter, $friendlyName, $status ); } /** * @param string $status * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` * @return UpdateConferenceOptions Options builder */ public static function update( string $status = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE ): UpdateConferenceOptions { return new UpdateConferenceOptions( $status, $announceUrl, $announceMethod ); } } class ReadConferenceOptions extends Options { /** * @param string $dateCreatedBefore 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 `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 `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 $dateUpdatedBefore 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 `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 `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 $friendlyName The string that identifies the Conference resources to read. * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null, string $dateUpdatedBefore = null, string $dateUpdated = null, string $dateUpdatedAfter = null, string $friendlyName = Values::NONE, string $status = Values::NONE ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; $this->options['dateUpdated'] = $dateUpdated; $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * 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 `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`. * @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 `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`. * @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 `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`. * @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 `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`. * @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 `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`. * @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 `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`. * @return $this Fluent Builder */ public function setDateUpdatedAfter(string $dateUpdatedAfter): self { $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; return $this; } /** * The string that identifies the Conference resources to read. * * @param string $friendlyName The string that identifies the Conference resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. * * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadConferenceOptions ' . $options . ']'; } } class UpdateConferenceOptions extends Options { /** * @param string $status * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` */ public function __construct( string $status = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE ) { $this->options['status'] = $status; $this->options['announceUrl'] = $announceUrl; $this->options['announceMethod'] = $announceMethod; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * @return $this Fluent Builder */ public function setAnnounceUrl(string $announceUrl): self { $this->options['announceUrl'] = $announceUrl; return $this; } /** * The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` * * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` * @return $this Fluent Builder */ public function setAnnounceMethod(string $announceMethod): self { $this->options['announceMethod'] = $announceMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateConferenceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php000064400000014316150364341760020663 0ustar00options['friendlyName'] = $friendlyName; $this->options['callDelay'] = $callDelay; $this->options['extension'] = $extension; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. * * @param int $callDelay The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. * @return $this Fluent Builder */ public function setCallDelay(int $callDelay): self { $this->options['callDelay'] = $callDelay; return $this; } /** * The digits to dial after connecting the verification call. * * @param string $extension The digits to dial after connecting the verification call. * @return $this Fluent Builder */ public function setExtension(string $extension): self { $this->options['extension'] = $extension; return $this; } /** * The URL we should call using the `status_callback_method` to send status information about the verification process to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information about the verification process to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateValidationRequestOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php000064400000003132150364341760017272 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationOptions.php000064400000015553150364341760017652 0ustar00=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return ReadNotificationOptions Options builder */ public static function read( int $log = Values::INT_NONE, string $messageDateBefore = null, string $messageDate = null, string $messageDateAfter = null ): ReadNotificationOptions { return new ReadNotificationOptions( $log, $messageDateBefore, $messageDate, $messageDateAfter ); } } class ReadNotificationOptions extends Options { /** * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ public function __construct( int $log = Values::INT_NONE, string $messageDateBefore = null, string $messageDate = null, string $messageDateAfter = null ) { $this->options['log'] = $log; $this->options['messageDateBefore'] = $messageDateBefore; $this->options['messageDate'] = $messageDate; $this->options['messageDateAfter'] = $messageDateAfter; } /** * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @return $this Fluent Builder */ public function setLog(int $log): self { $this->options['log'] = $log; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDateBefore(string $messageDateBefore): self { $this->options['messageDateBefore'] = $messageDateBefore; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDate(string $messageDate): self { $this->options['messageDate'] = $messageDate; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDateAfter(string $messageDateAfter): self { $this->options['messageDateAfter'] = $messageDateAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsageInstance.php000064400000003742150364341760016376 0ustar00solution = ['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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingList.php000064400000014445150364341760016417 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings.json'; } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordingPage Page of RecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordingPage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateCreated>' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'CallSid' => $options['callSid'], 'ConferenceSid' => $options['conferenceSid'], 'IncludeSoftDeleted' => Serialize::booleanToString($options['includeSoftDeleted']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordingPage Page of RecordingInstance */ public function getPage(string $targetUrl): RecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. */ public function getContext( string $sid ): RecordingContext { return new RecordingContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php000064400000004362150364341760017221 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php000064400000010270150364341760017373 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SigningKeyContext Context for this SigningKeyInstance */ protected function proxy(): SigningKeyContext { if (!$this->context) { $this->context = new SigningKeyContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SigningKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SigningKeyInstance * * @return SigningKeyInstance Fetched SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SigningKeyInstance { return $this->proxy()->fetch(); } /** * Update the SigningKeyInstance * * @param array|Options $options Optional Arguments * @return SigningKeyInstance Updated SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SigningKeyInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.SigningKeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php000064400000011231150364341760021413 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php000064400000011307150364341760021533 0ustar00solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($conferenceSid) .'/Participants/' . \rawurlencode($callSid) .'.json'; } /** * Delete the ParticipantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php000064400000013776150364341760021325 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * Update the RecordingInstance * * @param string $status * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { return $this->proxy()->update($status, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php000064400000007467150364341760021205 0ustar00solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($conferenceSid) .'/Recordings/' . \rawurlencode($sid) .'.json'; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the RecordingInstance * * @param string $status * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { $options = new Values($options); $data = Values::of([ 'Status' => $status, 'PauseBehavior' => $options['pauseBehavior'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php000064400000013433150364341760021655 0ustar00properties = [ '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; } /** * Delete the ParticipantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php000064400000003206150364341760020762 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php000064400000233171150364341760021547 0ustar00`, ``, ``, or `` verbs. * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @return UpdateParticipantOptions Options builder */ public static function update( bool $muted = Values::BOOL_NONE, bool $hold = Values::BOOL_NONE, string $holdUrl = Values::NONE, string $holdMethod = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $beepOnExit = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, bool $coaching = Values::BOOL_NONE, string $callSidToCoach = Values::NONE ): UpdateParticipantOptions { return new UpdateParticipantOptions( $muted, $hold, $holdUrl, $holdMethod, $announceUrl, $announceMethod, $waitUrl, $waitMethod, $beepOnExit, $endConferenceOnExit, $coaching, $callSidToCoach ); } } class CreateParticipantOptions extends Options { /** * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @param string $conferenceTrim Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $sipAuthUsername The SIP username used for authentication. * @param string $sipAuthPassword The SIP password for authentication. * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. */ public function __construct( string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, string $label = Values::NONE, int $timeout = Values::INT_NONE, bool $record = Values::BOOL_NONE, bool $muted = Values::BOOL_NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::BOOL_NONE, int $maxParticipants = Values::INT_NONE, string $conferenceRecord = Values::NONE, string $conferenceTrim = Values::NONE, string $conferenceStatusCallback = Values::NONE, string $conferenceStatusCallbackMethod = Values::NONE, array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, string $recordingChannels = Values::NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, string $region = Values::NONE, string $conferenceRecordingStatusCallback = Values::NONE, string $conferenceRecordingStatusCallbackMethod = Values::NONE, array $recordingStatusCallbackEvent = Values::ARRAY_NONE, array $conferenceRecordingStatusCallbackEvent = Values::ARRAY_NONE, bool $coaching = Values::BOOL_NONE, string $callSidToCoach = Values::NONE, string $jitterBufferSize = Values::NONE, string $byoc = Values::NONE, string $callerId = Values::NONE, string $callReason = Values::NONE, string $recordingTrack = Values::NONE, int $timeLimit = Values::INT_NONE, string $machineDetection = Values::NONE, int $machineDetectionTimeout = Values::INT_NONE, int $machineDetectionSpeechThreshold = Values::INT_NONE, int $machineDetectionSpeechEndThreshold = Values::INT_NONE, int $machineDetectionSilenceTimeout = Values::INT_NONE, string $amdStatusCallback = Values::NONE, string $amdStatusCallbackMethod = Values::NONE, string $trim = Values::NONE, string $callToken = Values::NONE ) { $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['label'] = $label; $this->options['timeout'] = $timeout; $this->options['record'] = $record; $this->options['muted'] = $muted; $this->options['beep'] = $beep; $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; $this->options['endConferenceOnExit'] = $endConferenceOnExit; $this->options['waitUrl'] = $waitUrl; $this->options['waitMethod'] = $waitMethod; $this->options['earlyMedia'] = $earlyMedia; $this->options['maxParticipants'] = $maxParticipants; $this->options['conferenceRecord'] = $conferenceRecord; $this->options['conferenceTrim'] = $conferenceTrim; $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['region'] = $region; $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; $this->options['coaching'] = $coaching; $this->options['callSidToCoach'] = $callSidToCoach; $this->options['jitterBufferSize'] = $jitterBufferSize; $this->options['byoc'] = $byoc; $this->options['callerId'] = $callerId; $this->options['callReason'] = $callReason; $this->options['recordingTrack'] = $recordingTrack; $this->options['timeLimit'] = $timeLimit; $this->options['machineDetection'] = $machineDetection; $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; $this->options['amdStatusCallback'] = $amdStatusCallback; $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; $this->options['trim'] = $trim; $this->options['callToken'] = $callToken; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. * * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. * @return $this Fluent Builder */ public function setStatusCallbackEvent(array $statusCallbackEvent): self { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. * * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. * @return $this Fluent Builder */ public function setLabel(string $label): self { $this->options['label'] = $label; return $this; } /** * The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. * * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setRecord(bool $record): self { $this->options['record'] = $record; return $this; } /** * Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. * * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setMuted(bool $muted): self { $this->options['muted'] = $muted; return $this; } /** * Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @return $this Fluent Builder */ public function setBeep(string $beep): self { $this->options['beep'] = $beep; return $this; } /** * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @return $this Fluent Builder */ public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setEndConferenceOnExit(bool $endConferenceOnExit): self { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @return $this Fluent Builder */ public function setWaitUrl(string $waitUrl): self { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @return $this Fluent Builder */ public function setWaitMethod(string $waitMethod): self { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. * * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. * @return $this Fluent Builder */ public function setEarlyMedia(bool $earlyMedia): self { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @return $this Fluent Builder */ public function setMaxParticipants(int $maxParticipants): self { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @return $this Fluent Builder */ public function setConferenceRecord(string $conferenceRecord): self { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * * @param string $conferenceTrim Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @return $this Fluent Builder */ public function setConferenceTrim(string $conferenceTrim): self { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @return $this Fluent Builder */ public function setConferenceStatusCallback(string $conferenceStatusCallback): self { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. * * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @return $this Fluent Builder */ public function setRecordingChannels(string $recordingChannels): self { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we should call using the `recording_status_callback_method` when the recording status changes. * * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @return $this Fluent Builder */ public function setRecordingStatusCallback(string $recordingStatusCallback): self { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The SIP username used for authentication. * * @param string $sipAuthUsername The SIP username used for authentication. * @return $this Fluent Builder */ public function setSipAuthUsername(string $sipAuthUsername): self { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The SIP password for authentication. * * @param string $sipAuthPassword The SIP password for authentication. * @return $this Fluent Builder */ public function setSipAuthPassword(string $sipAuthPassword): self { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @return $this Fluent Builder */ public function setRegion(string $region): self { $this->options['region'] = $region; return $this; } /** * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. * * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` * * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackEvent(array $conferenceRecordingStatusCallbackEvent): self { $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; return $this; } /** * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @return $this Fluent Builder */ public function setCoaching(bool $coaching): self { $this->options['coaching'] = $coaching; return $this; } /** * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @return $this Fluent Builder */ public function setCallSidToCoach(string $callSidToCoach): self { $this->options['callSidToCoach'] = $callSidToCoach; return $this; } /** * Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. * * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. * @return $this Fluent Builder */ public function setJitterBufferSize(string $jitterBufferSize): self { $this->options['jitterBufferSize'] = $jitterBufferSize; return $this; } /** * The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @return $this Fluent Builder */ public function setByoc(string $byoc): self { $this->options['byoc'] = $byoc; return $this; } /** * The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. * * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. * @return $this Fluent Builder */ public function setCallerId(string $callerId): self { $this->options['callerId'] = $callerId; return $this; } /** * The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @return $this Fluent Builder */ public function setCallReason(string $callReason): self { $this->options['callReason'] = $callReason; return $this; } /** * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. * * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. * @return $this Fluent Builder */ public function setRecordingTrack(string $recordingTrack): self { $this->options['recordingTrack'] = $recordingTrack; return $this; } /** * The maximum duration of the call in seconds. Constraints depend on account and configuration. * * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return $this Fluent Builder */ public function setTimeLimit(int $timeLimit): self { $this->options['timeLimit'] = $timeLimit; return $this; } /** * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @return $this Fluent Builder */ public function setMachineDetection(string $machineDetection): self { $this->options['machineDetection'] = $machineDetection; return $this; } /** * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @return $this Fluent Builder */ public function setMachineDetectionTimeout(int $machineDetectionTimeout): self { $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; return $this; } /** * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @return $this Fluent Builder */ public function setMachineDetectionSpeechThreshold(int $machineDetectionSpeechThreshold): self { $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; return $this; } /** * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @return $this Fluent Builder */ public function setMachineDetectionSpeechEndThreshold(int $machineDetectionSpeechEndThreshold): self { $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; return $this; } /** * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @return $this Fluent Builder */ public function setMachineDetectionSilenceTimeout(int $machineDetectionSilenceTimeout): self { $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; return $this; } /** * The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @return $this Fluent Builder */ public function setAmdStatusCallback(string $amdStatusCallback): self { $this->options['amdStatusCallback'] = $amdStatusCallback; return $this; } /** * The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setAmdStatusCallbackMethod(string $amdStatusCallbackMethod): self { $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; return $this; } /** * Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * * @param string $trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @return $this Fluent Builder */ public function setTrim(string $trim): self { $this->options['trim'] = $trim; return $this; } /** * A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * @return $this Fluent Builder */ public function setCallToken(string $callToken): self { $this->options['callToken'] = $callToken; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateParticipantOptions ' . $options . ']'; } } class ReadParticipantOptions extends Options { /** * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. */ public function __construct( bool $muted = Values::BOOL_NONE, bool $hold = Values::BOOL_NONE, bool $coaching = Values::BOOL_NONE ) { $this->options['muted'] = $muted; $this->options['hold'] = $hold; $this->options['coaching'] = $coaching; } /** * Whether to return only participants that are muted. Can be: `true` or `false`. * * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMuted(bool $muted): self { $this->options['muted'] = $muted; return $this; } /** * Whether to return only participants that are on hold. Can be: `true` or `false`. * * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setHold(bool $hold): self { $this->options['hold'] = $hold; return $this; } /** * Whether to return only participants who are coaching another call. Can be: `true` or `false`. * * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setCoaching(bool $coaching): self { $this->options['coaching'] = $coaching; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadParticipantOptions ' . $options . ']'; } } class UpdateParticipantOptions extends Options { /** * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. */ public function __construct( bool $muted = Values::BOOL_NONE, bool $hold = Values::BOOL_NONE, string $holdUrl = Values::NONE, string $holdMethod = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $beepOnExit = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, bool $coaching = Values::BOOL_NONE, string $callSidToCoach = Values::NONE ) { $this->options['muted'] = $muted; $this->options['hold'] = $hold; $this->options['holdUrl'] = $holdUrl; $this->options['holdMethod'] = $holdMethod; $this->options['announceUrl'] = $announceUrl; $this->options['announceMethod'] = $announceMethod; $this->options['waitUrl'] = $waitUrl; $this->options['waitMethod'] = $waitMethod; $this->options['beepOnExit'] = $beepOnExit; $this->options['endConferenceOnExit'] = $endConferenceOnExit; $this->options['coaching'] = $coaching; $this->options['callSidToCoach'] = $callSidToCoach; } /** * Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. * * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. * @return $this Fluent Builder */ public function setMuted(bool $muted): self { $this->options['muted'] = $muted; return $this; } /** * Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. * * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. * @return $this Fluent Builder */ public function setHold(bool $hold): self { $this->options['hold'] = $hold; return $this; } /** * The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * @return $this Fluent Builder */ public function setHoldUrl(string $holdUrl): self { $this->options['holdUrl'] = $holdUrl; return $this; } /** * The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * @return $this Fluent Builder */ public function setHoldMethod(string $holdMethod): self { $this->options['holdMethod'] = $holdMethod; return $this; } /** * The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. * @return $this Fluent Builder */ public function setAnnounceUrl(string $announceUrl): self { $this->options['announceUrl'] = $announceUrl; return $this; } /** * The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setAnnounceMethod(string $announceMethod): self { $this->options['announceMethod'] = $announceMethod; return $this; } /** * The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @return $this Fluent Builder */ public function setWaitUrl(string $waitUrl): self { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @return $this Fluent Builder */ public function setWaitMethod(string $waitMethod): self { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setBeepOnExit(bool $beepOnExit): self { $this->options['beepOnExit'] = $beepOnExit; return $this; } /** * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setEndConferenceOnExit(bool $endConferenceOnExit): self { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @return $this Fluent Builder */ public function setCoaching(bool $coaching): self { $this->options['coaching'] = $coaching; return $this; } /** * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @return $this Fluent Builder */ public function setCallSidToCoach(string $callSidToCoach): self { $this->options['callSidToCoach'] = $callSidToCoach; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php000064400000021200150364341760021171 0ustar00=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return ReadRecordingOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ): ReadRecordingOptions { return new ReadRecordingOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter ); } /** * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * @return UpdateRecordingOptions Options builder */ public static function update( string $pauseBehavior = Values::NONE ): UpdateRecordingOptions { return new UpdateRecordingOptions( $pauseBehavior ); } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; } } class UpdateRecordingOptions extends Options { /** * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. */ public function __construct( string $pauseBehavior = Values::NONE ) { $this->options['pauseBehavior'] = $pauseBehavior; } /** * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * @return $this Fluent Builder */ public function setPauseBehavior(string $pauseBehavior): self { $this->options['pauseBehavior'] = $pauseBehavior; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php000064400000003172150364341760020422 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php000064400000014607150364341760020466 0ustar00solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($conferenceSid) .'/Recordings.json'; } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordingPage Page of RecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordingPage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordingPage Page of RecordingInstance */ public function getPage(string $targetUrl): RecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The Twilio-provided string that uniquely identifies the Conference Recording resource to delete. */ public function getContext( string $sid ): RecordingContext { return new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php000064400000030611150364341760021021 0ustar00solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($conferenceSid) .'/Participants.json'; } /** * Create the ParticipantInstance * * @param string $from The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `from` must also be a phone number. If `to` is sip address, this value of `from` should be a username portion to be used to populate the P-Asserted-Identity header that is passed to the SIP endpoint. * @param string $to The phone number, SIP address, or Client identifier that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `sip:name@company.com`. Client identifiers are formatted `client:name`. [Custom parameters](https://www.twilio.com/docs/voice/api/conference-participant-resource#custom-parameters) may also be specified. * @param array|Options $options Optional Arguments * @return ParticipantInstance Created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $from, string $to, array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'From' => $from, 'To' => $to, 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function ($e) { return $e; }), 'Label' => $options['label'], 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => Serialize::map($options['conferenceStatusCallbackEvent'], function ($e) { return $e; }), 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'Region' => $options['region'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), 'ConferenceRecordingStatusCallbackEvent' => Serialize::map($options['conferenceRecordingStatusCallbackEvent'], function ($e) { return $e; }), 'Coaching' => Serialize::booleanToString($options['coaching']), 'CallSidToCoach' => $options['callSidToCoach'], 'JitterBufferSize' => $options['jitterBufferSize'], 'Byoc' => $options['byoc'], 'CallerId' => $options['callerId'], 'CallReason' => $options['callReason'], 'RecordingTrack' => $options['recordingTrack'], 'TimeLimit' => $options['timeLimit'], 'MachineDetection' => $options['machineDetection'], 'MachineDetectionTimeout' => $options['machineDetectionTimeout'], 'MachineDetectionSpeechThreshold' => $options['machineDetectionSpeechThreshold'], 'MachineDetectionSpeechEndThreshold' => $options['machineDetectionSpeechEndThreshold'], 'MachineDetectionSilenceTimeout' => $options['machineDetectionSilenceTimeout'], 'AmdStatusCallback' => $options['amdStatusCallback'], 'AmdStatusCallbackMethod' => $options['amdStatusCallbackMethod'], 'Trim' => $options['trim'], 'CallToken' => $options['callToken'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'] ); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $options = new Values($options); $params = Values::of([ 'Muted' => Serialize::booleanToString($options['muted']), 'Hold' => Serialize::booleanToString($options['hold']), 'Coaching' => Serialize::booleanToString($options['coaching']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to delete. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. */ public function getContext( string $callSid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $callSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ParticipantList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsagePage.php000064400000003052150364341760015500 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php000064400000036525150364341760016613 0ustar00options['friendlyName'] = $friendlyName; $this->options['emergencyEnabled'] = $emergencyEnabled; $this->options['autoCorrectAddress'] = $autoCorrectAddress; $this->options['streetSecondary'] = $streetSecondary; } /** * A descriptive string that you create to describe the new address. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new address. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to enable emergency calling on the new address. Can be: `true` or `false`. * * @param bool $emergencyEnabled Whether to enable emergency calling on the new address. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setEmergencyEnabled(bool $emergencyEnabled): self { $this->options['emergencyEnabled'] = $emergencyEnabled; return $this; } /** * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @return $this Fluent Builder */ public function setAutoCorrectAddress(bool $autoCorrectAddress): self { $this->options['autoCorrectAddress'] = $autoCorrectAddress; return $this; } /** * The additional number and street address of the address. * * @param string $streetSecondary The additional number and street address of the address. * @return $this Fluent Builder */ public function setStreetSecondary(string $streetSecondary): self { $this->options['streetSecondary'] = $streetSecondary; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateAddressOptions ' . $options . ']'; } } class ReadAddressOptions extends Options { /** * @param string $customerName The `customer_name` of the Address resources to read. * @param string $friendlyName The string that identifies the Address resources to read. * @param string $isoCountry The ISO country code of the Address resources to read. */ public function __construct( string $customerName = Values::NONE, string $friendlyName = Values::NONE, string $isoCountry = Values::NONE ) { $this->options['customerName'] = $customerName; $this->options['friendlyName'] = $friendlyName; $this->options['isoCountry'] = $isoCountry; } /** * The `customer_name` of the Address resources to read. * * @param string $customerName The `customer_name` of the Address resources to read. * @return $this Fluent Builder */ public function setCustomerName(string $customerName): self { $this->options['customerName'] = $customerName; return $this; } /** * The string that identifies the Address resources to read. * * @param string $friendlyName The string that identifies the Address resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The ISO country code of the Address resources to read. * * @param string $isoCountry The ISO country code of the Address resources to read. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadAddressOptions ' . $options . ']'; } } class UpdateAddressOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. * @param string $customerName The name to associate with the address. * @param string $street The number and street address of the address. * @param string $city The city of the address. * @param string $region The state or region of the address. * @param string $postalCode The postal code of the address. * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @param string $streetSecondary The additional number and street address of the address. */ public function __construct( string $friendlyName = Values::NONE, string $customerName = Values::NONE, string $street = Values::NONE, string $city = Values::NONE, string $region = Values::NONE, string $postalCode = Values::NONE, bool $emergencyEnabled = Values::BOOL_NONE, bool $autoCorrectAddress = Values::BOOL_NONE, string $streetSecondary = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['customerName'] = $customerName; $this->options['street'] = $street; $this->options['city'] = $city; $this->options['region'] = $region; $this->options['postalCode'] = $postalCode; $this->options['emergencyEnabled'] = $emergencyEnabled; $this->options['autoCorrectAddress'] = $autoCorrectAddress; $this->options['streetSecondary'] = $streetSecondary; } /** * A descriptive string that you create to describe the address. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The name to associate with the address. * * @param string $customerName The name to associate with the address. * @return $this Fluent Builder */ public function setCustomerName(string $customerName): self { $this->options['customerName'] = $customerName; return $this; } /** * The number and street address of the address. * * @param string $street The number and street address of the address. * @return $this Fluent Builder */ public function setStreet(string $street): self { $this->options['street'] = $street; return $this; } /** * The city of the address. * * @param string $city The city of the address. * @return $this Fluent Builder */ public function setCity(string $city): self { $this->options['city'] = $city; return $this; } /** * The state or region of the address. * * @param string $region The state or region of the address. * @return $this Fluent Builder */ public function setRegion(string $region): self { $this->options['region'] = $region; return $this; } /** * The postal code of the address. * * @param string $postalCode The postal code of the address. * @return $this Fluent Builder */ public function setPostalCode(string $postalCode): self { $this->options['postalCode'] = $postalCode; return $this; } /** * Whether to enable emergency calling on the address. Can be: `true` or `false`. * * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setEmergencyEnabled(bool $emergencyEnabled): self { $this->options['emergencyEnabled'] = $emergencyEnabled; return $this; } /** * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @return $this Fluent Builder */ public function setAutoCorrectAddress(bool $autoCorrectAddress): self { $this->options['autoCorrectAddress'] = $autoCorrectAddress; return $this; } /** * The additional number and street address of the address. * * @param string $streetSecondary The additional number and street address of the address. * @return $this Fluent Builder */ public function setStreetSecondary(string $streetSecondary): self { $this->options['streetSecondary'] = $streetSecondary; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateAddressOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationPage.php000064400000003116150364341760016700 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php000064400000004527150364341760017642 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php000064400000021353150364341760016063 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Messages.json'; } /** * Create the MessageInstance * * @param string $to The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'StatusCallback' => $options['statusCallback'], 'ApplicationSid' => $options['applicationSid'], 'MaxPrice' => $options['maxPrice'], 'ProvideFeedback' => Serialize::booleanToString($options['provideFeedback']), 'Attempt' => $options['attempt'], 'ValidityPeriod' => $options['validityPeriod'], 'ForceDelivery' => Serialize::booleanToString($options['forceDelivery']), 'ContentRetention' => $options['contentRetention'], 'AddressRetention' => $options['addressRetention'], 'SmartEncoded' => Serialize::booleanToString($options['smartEncoded']), 'PersistentAction' => Serialize::map($options['persistentAction'], function ($e) { return $e; }), 'ShortenUrls' => Serialize::booleanToString($options['shortenUrls']), 'ScheduleType' => $options['scheduleType'], 'SendAt' => Serialize::iso8601DateTime($options['sendAt']), 'SendAsMms' => Serialize::booleanToString($options['sendAsMms']), 'ContentVariables' => $options['contentVariables'], 'RiskCheck' => $options['riskCheck'], 'From' => $options['from'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'Body' => $options['body'], 'MediaUrl' => Serialize::map($options['mediaUrl'], function ($e) { return $e; }), 'ContentSid' => $options['contentSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'To' => $options['to'], 'From' => $options['from'], 'DateSent<' => Serialize::iso8601DateTime($options['dateSentBefore']), 'DateSent' => Serialize::iso8601DateTime($options['dateSent']), 'DateSent>' => Serialize::iso8601DateTime($options['dateSentAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The SID of the Message resource you wish to delete */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MessageList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php000064400000064245150364341760017170 0ustar00options['friendlyName'] = $friendlyName; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; $this->options['sipRegistration'] = $sipRegistration; $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; $this->options['secure'] = $secure; $this->options['byocTrunkSid'] = $byocTrunkSid; $this->options['emergencyCallerSid'] = $emergencyCallerSid; } /** * A descriptive string that you created to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should when the domain receives a call. * * @param string $voiceUrl The URL we should when the domain receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @return $this Fluent Builder */ public function setVoiceStatusCallbackUrl(string $voiceStatusCallbackUrl): self { $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceStatusCallbackMethod(string $voiceStatusCallbackMethod): self { $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; return $this; } /** * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @return $this Fluent Builder */ public function setSipRegistration(bool $sipRegistration): self { $this->options['sipRegistration'] = $sipRegistration; return $this; } /** * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @return $this Fluent Builder */ public function setEmergencyCallingEnabled(bool $emergencyCallingEnabled): self { $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; return $this; } /** * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @return $this Fluent Builder */ public function setSecure(bool $secure): self { $this->options['secure'] = $secure; return $this; } /** * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @return $this Fluent Builder */ public function setByocTrunkSid(string $byocTrunkSid): self { $this->options['byocTrunkSid'] = $byocTrunkSid; return $this; } /** * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * @return $this Fluent Builder */ public function setEmergencyCallerSid(string $emergencyCallerSid): self { $this->options['emergencyCallerSid'] = $emergencyCallerSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateDomainOptions ' . $options . ']'; } } class UpdateDomainOptions extends Options { /** * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $voiceUrl The URL we should call when the domain receives a call. * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. */ public function __construct( string $friendlyName = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceStatusCallbackMethod = Values::NONE, string $voiceStatusCallbackUrl = Values::NONE, string $voiceUrl = Values::NONE, bool $sipRegistration = Values::BOOL_NONE, string $domainName = Values::NONE, bool $emergencyCallingEnabled = Values::BOOL_NONE, bool $secure = Values::BOOL_NONE, string $byocTrunkSid = Values::NONE, string $emergencyCallerSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; $this->options['voiceUrl'] = $voiceUrl; $this->options['sipRegistration'] = $sipRegistration; $this->options['domainName'] = $domainName; $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; $this->options['secure'] = $secure; $this->options['byocTrunkSid'] = $byocTrunkSid; $this->options['emergencyCallerSid'] = $emergencyCallerSid; } /** * A descriptive string that you created to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_url` * * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceStatusCallbackMethod(string $voiceStatusCallbackMethod): self { $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @return $this Fluent Builder */ public function setVoiceStatusCallbackUrl(string $voiceStatusCallbackUrl): self { $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; return $this; } /** * The URL we should call when the domain receives a call. * * @param string $voiceUrl The URL we should call when the domain receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @return $this Fluent Builder */ public function setSipRegistration(bool $sipRegistration): self { $this->options['sipRegistration'] = $sipRegistration; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * @return $this Fluent Builder */ public function setDomainName(string $domainName): self { $this->options['domainName'] = $domainName; return $this; } /** * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @return $this Fluent Builder */ public function setEmergencyCallingEnabled(bool $emergencyCallingEnabled): self { $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; return $this; } /** * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @return $this Fluent Builder */ public function setSecure(bool $secure): self { $this->options['secure'] = $secure; return $this; } /** * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @return $this Fluent Builder */ public function setByocTrunkSid(string $byocTrunkSid): self { $this->options['byocTrunkSid'] = $byocTrunkSid; return $this; } /** * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * @return $this Fluent Builder */ public function setEmergencyCallerSid(string $emergencyCallerSid): self { $this->options['emergencyCallerSid'] = $emergencyCallerSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateDomainOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php000064400000011755150364341760020776 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialListContext Context for this CredentialListInstance */ protected function proxy(): CredentialListContext { if (!$this->context) { $this->context = new CredentialListContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { return $this->proxy()->fetch(); } /** * Update the CredentialListInstance * * @param string $friendlyName A human readable descriptive text for a CredentialList, up to 64 characters long. * @return CredentialListInstance Updated CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): CredentialListInstance { return $this->proxy()->update($friendlyName); } /** * Access the credentials */ protected function getCredentials(): CredentialList { return $this->proxy()->credentials; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php000064400000005771150364341760023402 0ustar00solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/CredentialListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the CredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php000064400000011223150364341760023507 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'domainSid' => Values::array_get($payload, 'domain_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialListMappingContext Context for this CredentialListMappingInstance */ protected function proxy(): CredentialListMappingContext { if (!$this->context) { $this->context = new CredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialListMappingInstance * * @return CredentialListMappingInstance Fetched CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php000064400000011235150364341760035302 0ustar00sdk/src/Twilio/Rest/Api/V2010/Accountproperties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthRegistrationsCredentialListMappingContext Context for this AuthRegistrationsCredentialListMappingInstance */ protected function proxy(): AuthRegistrationsCredentialListMappingContext { if (!$this->context) { $this->context = new AuthRegistrationsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AuthRegistrationsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AuthRegistrationsCredentialListMappingInstance * * @return AuthRegistrationsCredentialListMappingInstance Fetched AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthRegistrationsCredentialListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php000064400000006244150364341760035166 0ustar00sdk/src/Twilio/Rest/Api/V2010solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Registrations/CredentialListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the AuthRegistrationsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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.php000064400000016364150364341760034461 0ustar00sdk/src/Twilio/Rest/Api/V2010solution = [ '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'] ); } /** * Reads AuthRegistrationsCredentialListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthRegistrationsCredentialListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AuthRegistrationsCredentialListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthRegistrationsCredentialListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthRegistrationsCredentialListMappingPage Page of AuthRegistrationsCredentialListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthRegistrationsCredentialListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthRegistrationsCredentialListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthRegistrationsCredentialListMappingPage Page of AuthRegistrationsCredentialListMappingInstance */ public function getPage(string $targetUrl): AuthRegistrationsCredentialListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthRegistrationsCredentialListMappingContext * * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. */ public function getContext( string $sid ): AuthRegistrationsCredentialListMappingContext { return new AuthRegistrationsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingList]'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php000064400000003544150364341760034416 0ustar00sdk/src/Twilio/Rest/Api/V2010solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php000064400000010776150364341760023120 0ustar00solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; } /** * Access the ipAccessControlListMappings */ protected function getIpAccessControlListMappings(): AuthCallsIpAccessControlListMappingList { if (!$this->_ipAccessControlListMappings) { $this->_ipAccessControlListMappings = new AuthCallsIpAccessControlListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_ipAccessControlListMappings; } /** * Access the credentialListMappings */ protected function getCredentialListMappings(): AuthCallsCredentialListMappingList { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new AuthCallsCredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_credentialListMappings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypeCallsList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php000064400000004276150364341760025546 0ustar00solution = ['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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php000064400000003242150364341760023047 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php000064400000003322150364341760024645 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php000064400000007261150364341760024712 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php000064400000004246150364341760023744 0ustar00solution = ['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]'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php000064400000011065150364341760031705 0ustar00sdk/src/Twilioproperties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthCallsCredentialListMappingContext Context for this AuthCallsCredentialListMappingInstance */ protected function proxy(): AuthCallsCredentialListMappingContext { if (!$this->context) { $this->context = new AuthCallsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AuthCallsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AuthCallsCredentialListMappingInstance * * @return AuthCallsCredentialListMappingInstance Fetched AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsCredentialListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php000064400000003444150364341760031017 0ustar00sdk/src/Twiliosolution = $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/AuthCallsIpAccessControlListMappingPage.php000064400000003502150364341760031773 0ustar00sdk/src/Twilio/Restsolution = $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/AuthCallsIpAccessControlListMappingContext.php000064400000006203150364341760032544 0ustar00sdk/src/Twilio/Restsolution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Calls/IpAccessControlListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the AuthCallsIpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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.php000064400000016277150364341760032047 0ustar00sdk/src/Twilio/Restsolution = [ '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'] ); } /** * Reads AuthCallsIpAccessControlListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthCallsIpAccessControlListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AuthCallsIpAccessControlListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthCallsIpAccessControlListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthCallsIpAccessControlListMappingPage Page of AuthCallsIpAccessControlListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthCallsIpAccessControlListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthCallsIpAccessControlListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthCallsIpAccessControlListMappingPage Page of AuthCallsIpAccessControlListMappingInstance */ public function getPage(string $targetUrl): AuthCallsIpAccessControlListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthCallsIpAccessControlListMappingContext * * @param string $sid The Twilio-provided string that uniquely identifies the IpAccessControlListMapping resource to delete. */ public function getContext( string $sid ): AuthCallsIpAccessControlListMappingContext { return new AuthCallsIpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingList]'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php000064400000006114150364341760031564 0ustar00sdk/src/Twiliosolution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Calls/CredentialListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the AuthCallsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php000064400000016044150364341760031056 0ustar00sdk/src/Twiliosolution = [ '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'] ); } /** * Reads AuthCallsCredentialListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthCallsCredentialListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AuthCallsCredentialListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthCallsCredentialListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthCallsCredentialListMappingPage Page of AuthCallsCredentialListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthCallsCredentialListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthCallsCredentialListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthCallsCredentialListMappingPage Page of AuthCallsCredentialListMappingInstance */ public function getPage(string $targetUrl): AuthCallsCredentialListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthCallsCredentialListMappingContext * * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. */ public function getContext( string $sid ): AuthCallsCredentialListMappingContext { return new AuthCallsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthCallsCredentialListMappingList]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php000064400000011166150364341760032670 0ustar00sdk/src/Twilio/Restproperties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthCallsIpAccessControlListMappingContext Context for this AuthCallsIpAccessControlListMappingInstance */ protected function proxy(): AuthCallsIpAccessControlListMappingContext { if (!$this->context) { $this->context = new AuthCallsIpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AuthCallsIpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AuthCallsIpAccessControlListMappingInstance * * @return AuthCallsIpAccessControlListMappingInstance Fetched AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsIpAccessControlListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php000064400000005717150364341760024363 0ustar00solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/IpAccessControlListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the IpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php000064400000015556150364341760022673 0ustar00solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/CredentialListMappings.json'; } /** * Create the CredentialListMappingInstance * * @param string $credentialListSid A 34 character string that uniquely identifies the CredentialList resource to map to the SIP domain. * @return CredentialListMappingInstance Created CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentialListSid): CredentialListMappingInstance { $data = Values::of([ 'CredentialListSid' => $credentialListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Reads CredentialListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialListMappingPage Page of CredentialListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialListMappingPage Page of CredentialListMappingInstance */ public function getPage(string $targetUrl): CredentialListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a CredentialListMappingContext * * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): CredentialListMappingContext { return new CredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialListMappingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php000064400000015604150364341760023646 0ustar00solution = [ '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'] ); } /** * Reads IpAccessControlListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpAccessControlListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpAccessControlListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpAccessControlListMappingPage Page of IpAccessControlListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpAccessControlListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpAccessControlListMappingPage Page of IpAccessControlListMappingInstance */ public function getPage(string $targetUrl): IpAccessControlListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Constructs a IpAccessControlListMappingContext * * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): IpAccessControlListMappingContext { return new IpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAccessControlListMappingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php000064400000003334150364341760023604 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php000064400000007477150364341760020402 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php000064400000003166150364341760020332 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php000064400000003276150364341760022630 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php000064400000004220150364341760021212 0ustar00solution = ['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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php000064400000011163150364341760024473 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'domainSid' => Values::array_get($payload, 'domain_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpAccessControlListMappingContext Context for this IpAccessControlListMappingInstance */ protected function proxy(): IpAccessControlListMappingContext { if (!$this->context) { $this->context = new IpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpAccessControlListMappingInstance * * @return IpAccessControlListMappingInstance Fetched IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php000064400000003150150364341760020074 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php000064400000003070150364341760016376 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php000064400000014665150364341760021131 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/IpAccessControlLists.json'; } /** * Create the IpAccessControlListInstance * * @param string $friendlyName A human readable descriptive text that describes the IpAccessControlList, up to 255 characters long. * @return IpAccessControlListInstance Created IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): IpAccessControlListInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads IpAccessControlListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpAccessControlListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpAccessControlListPage Page of IpAccessControlListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpAccessControlListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpAccessControlListPage Page of IpAccessControlListInstance */ public function getPage(string $targetUrl): IpAccessControlListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Constructs a IpAccessControlListContext * * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): IpAccessControlListContext { return new IpAccessControlListContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAccessControlListList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php000064400000003206150364341760021057 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php000064400000015647150364341760022223 0ustar00solution = [ 'accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/CredentialLists/' . \rawurlencode($credentialListSid) .'/Credentials.json'; } /** * Create the CredentialInstance * * @param string $username The username that will be passed when authenticating SIP requests. The username should be sent in response to Twilio's challenge of the initial INVITE. It can be up to 32 characters long. * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $username, string $password): CredentialInstance { $data = Values::of([ 'Username' => $username, 'Password' => $password, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'] ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid The unique id that identifies the resource to delete. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $this->solution['accountSid'], $this->solution['credentialListSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php000064400000004751150364341760022735 0ustar00options['password'] = $password; } /** * The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * @return $this Fluent Builder */ public function setPassword(string $password): self { $this->options['password'] = $password; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php000064400000011566150364341760023050 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'credentialListSid' => Values::array_get($payload, 'credential_list_sid'), 'username' => Values::array_get($payload, 'username'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['accountSid'], $this->solution['credentialListSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php000064400000003224150364341760022150 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php000064400000007234150364341760022725 0ustar00solution = [ 'accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/CredentialLists/' . \rawurlencode($credentialListSid) .'/Credentials/' . \rawurlencode($sid) .'.json'; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php000064400000012133150364341760021746 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpAccessControlListContext Context for this IpAccessControlListInstance */ protected function proxy(): IpAccessControlListContext { if (!$this->context) { $this->context = new IpAccessControlListContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { return $this->proxy()->fetch(); } /** * Update the IpAccessControlListInstance * * @param string $friendlyName A human readable descriptive text, up to 255 characters long. * @return IpAccessControlListInstance Updated IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): IpAccessControlListInstance { return $this->proxy()->update($friendlyName); } /** * Access the ipAddresses */ protected function getIpAddresses(): IpAddressList { return $this->proxy()->ipAddresses; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php000064400000016541150364341760016444 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains.json'; } /** * Create the DomainInstance * * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * @param array|Options $options Optional Arguments * @return DomainInstance Created DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $domainName, array $options = []): DomainInstance { $options = new Values($options); $data = Values::of([ 'DomainName' => $domainName, 'FriendlyName' => $options['friendlyName'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceStatusCallbackUrl' => $options['voiceStatusCallbackUrl'], 'VoiceStatusCallbackMethod' => $options['voiceStatusCallbackMethod'], 'SipRegistration' => Serialize::booleanToString($options['sipRegistration']), 'EmergencyCallingEnabled' => Serialize::booleanToString($options['emergencyCallingEnabled']), 'Secure' => Serialize::booleanToString($options['secure']), 'ByocTrunkSid' => $options['byocTrunkSid'], 'EmergencyCallerSid' => $options['emergencyCallerSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DomainInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads DomainInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DomainInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DomainInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DomainInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DomainPage Page of DomainInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DomainPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DomainPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DomainInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DomainPage Page of DomainInstance */ public function getPage(string $targetUrl): DomainPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DomainPage($this->version, $response, $this->solution); } /** * Constructs a DomainContext * * @param string $sid The Twilio-provided string that uniquely identifies the SipDomain resource to delete. */ public function getContext( string $sid ): DomainContext { return new DomainContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DomainList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php000064400000014510150364341760020135 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/CredentialLists.json'; } /** * Create the CredentialListInstance * * @param string $friendlyName A human readable descriptive text that describes the CredentialList, up to 64 characters long. * @return CredentialListInstance Created CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): CredentialListInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads CredentialListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialListPage Page of CredentialListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialListPage Page of CredentialListInstance */ public function getPage(string $targetUrl): CredentialListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListPage($this->version, $response, $this->solution); } /** * Constructs a CredentialListContext * * @param string $sid The credential list Sid that uniquely identifies this resource */ public function getContext( string $sid ): CredentialListContext { return new CredentialListContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialListList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php000064400000012125150364341760020646 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/CredentialLists/' . \rawurlencode($sid) .'.json'; } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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 A human readable descriptive text for a CredentialList, up to 64 characters long. * @return CredentialListInstance Updated CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): CredentialListInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the credentials */ protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_credentials; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php000064400000012300150364341760021622 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/IpAccessControlLists/' . \rawurlencode($sid) .'.json'; } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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 descriptive text, up to 255 characters long. * @return IpAccessControlListInstance Updated IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): IpAccessControlListInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the ipAddresses */ protected function getIpAddresses(): IpAddressList { if (!$this->_ipAddresses) { $this->_ipAddresses = new IpAddressList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_ipAddresses; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php000064400000016140150364341760022775 0ustar00solution = [ 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) .'/IpAddresses.json'; } /** * Create the IpAddressInstance * * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * @param array|Options $options Optional Arguments * @return IpAddressInstance Created IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $ipAddress, array $options = []): IpAddressInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'IpAddress' => $ipAddress, 'CidrPrefixLength' => $options['cidrPrefixLength'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'] ); } /** * Reads IpAddressInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAddressInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpAddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpAddressInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpAddressPage Page of IpAddressInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpAddressPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpAddressPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAddressInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpAddressPage Page of IpAddressInstance */ public function getPage(string $targetUrl): IpAddressPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAddressPage($this->version, $response, $this->solution); } /** * Constructs a IpAddressContext * * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): IpAddressContext { return new IpAddressContext( $this->version, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAddressList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php000064400000003235150364341760022737 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php000064400000012300150364341760023620 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'ipAddress' => Values::array_get($payload, 'ip_address'), 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_length'), 'ipAccessControlListSid' => Values::array_get($payload, 'ip_access_control_list_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpAddressContext Context for this IpAddressInstance */ protected function proxy(): IpAddressContext { if (!$this->context) { $this->context = new IpAddressContext( $this->version, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IpAddressInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpAddressInstance * * @return IpAddressInstance Fetched IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAddressInstance { return $this->proxy()->fetch(); } /** * Update the IpAddressInstance * * @param array|Options $options Optional Arguments * @return IpAddressInstance Updated IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IpAddressInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAddressInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php000064400000007614150364341760023514 0ustar00solution = [ 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) .'/IpAddresses/' . \rawurlencode($sid) .'.json'; } /** * Delete the IpAddressInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php000064400000014063150364341760023517 0ustar00options['cidrPrefixLength'] = $cidrPrefixLength; } /** * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * @return $this Fluent Builder */ public function setCidrPrefixLength(int $cidrPrefixLength): self { $this->options['cidrPrefixLength'] = $cidrPrefixLength; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateIpAddressOptions ' . $options . ']'; } } class UpdateIpAddressOptions extends Options { /** * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. */ public function __construct( string $ipAddress = Values::NONE, string $friendlyName = Values::NONE, int $cidrPrefixLength = Values::INT_NONE ) { $this->options['ipAddress'] = $ipAddress; $this->options['friendlyName'] = $friendlyName; $this->options['cidrPrefixLength'] = $cidrPrefixLength; } /** * An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * @return $this Fluent Builder */ public function setIpAddress(string $ipAddress): self { $this->options['ipAddress'] = $ipAddress; return $this; } /** * A human readable descriptive text for this resource, up to 255 characters long. * * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * @return $this Fluent Builder */ public function setCidrPrefixLength(int $cidrPrefixLength): self { $this->options['cidrPrefixLength'] = $cidrPrefixLength; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateIpAddressOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php000064400000016676150364341760017166 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($sid) .'.json'; } /** * Delete the DomainInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the credentialListMappings */ protected function getCredentialListMappings(): CredentialListMappingList { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new CredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_credentialListMappings; } /** * Access the ipAccessControlListMappings */ protected function getIpAccessControlListMappings(): IpAccessControlListMappingList { if (!$this->_ipAccessControlListMappings) { $this->_ipAccessControlListMappings = new IpAccessControlListMappingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_ipAccessControlListMappings; } /** * Access the auth */ protected function getAuth(): AuthTypesList { if (!$this->_auth) { $this->_auth = new AuthTypesList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_auth; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.DomainContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php000064400000016231150364341760017271 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'authType' => Values::array_get($payload, 'auth_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'domainName' => Values::array_get($payload, 'domain_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceStatusCallbackMethod' => Values::array_get($payload, 'voice_status_callback_method'), 'voiceStatusCallbackUrl' => Values::array_get($payload, 'voice_status_callback_url'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'sipRegistration' => Values::array_get($payload, 'sip_registration'), 'emergencyCallingEnabled' => Values::array_get($payload, 'emergency_calling_enabled'), 'secure' => Values::array_get($payload, 'secure'), 'byocTrunkSid' => Values::array_get($payload, 'byoc_trunk_sid'), 'emergencyCallerSid' => Values::array_get($payload, 'emergency_caller_sid'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DomainContext Context for this DomainInstance */ protected function proxy(): DomainContext { if (!$this->context) { $this->context = new DomainContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DomainInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DomainInstance * * @return DomainInstance Fetched DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainInstance { return $this->proxy()->fetch(); } /** * Update the DomainInstance * * @param array|Options $options Optional Arguments * @return DomainInstance Updated DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DomainInstance { return $this->proxy()->update($options); } /** * Access the credentialListMappings */ protected function getCredentialListMappings(): CredentialListMappingList { return $this->proxy()->credentialListMappings; } /** * Access the ipAccessControlListMappings */ protected function getIpAccessControlListMappings(): IpAccessControlListMappingList { return $this->proxy()->ipAccessControlListMappings; } /** * Access the auth */ protected function getAuth(): AuthTypesList { return $this->proxy()->auth; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.DomainInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeList.php000064400000013561150364341760016373 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SMS/ShortCodes.json'; } /** * Reads ShortCodeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ShortCodeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ShortCodePage Page of ShortCodeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ShortCodePage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'ShortCode' => $options['shortCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ShortCodePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ShortCodeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ShortCodePage Page of ShortCodeInstance */ public function getPage(string $targetUrl): ShortCodePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Constructs a ShortCodeContext * * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch */ public function getContext( string $sid ): ShortCodeContext { return new ShortCodeContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ShortCodeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenOptions.php000064400000004032150364341760016272 0ustar00options['ttl'] = $ttl; } /** * The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). * * @param int $ttl The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateTokenOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessagePage.php000064400000003236150364341760021015 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php000064400000042224150364341760017507 0ustar00 Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. * @param string $paymentMethod * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. * @param string $tokenType * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` * @return CreatePaymentOptions Options builder */ public static function create( string $bankAccountType = Values::NONE, string $chargeAmount = Values::NONE, string $currency = Values::NONE, string $description = Values::NONE, string $input = Values::NONE, int $minPostalCodeLength = Values::INT_NONE, array $parameter = Values::ARRAY_NONE, string $paymentConnector = Values::NONE, string $paymentMethod = Values::NONE, bool $postalCode = Values::BOOL_NONE, bool $securityCode = Values::BOOL_NONE, int $timeout = Values::INT_NONE, string $tokenType = Values::NONE, string $validCardTypes = Values::NONE ): CreatePaymentOptions { return new CreatePaymentOptions( $bankAccountType, $chargeAmount, $currency, $description, $input, $minPostalCodeLength, $parameter, $paymentConnector, $paymentMethod, $postalCode, $securityCode, $timeout, $tokenType, $validCardTypes ); } /** * @param string $capture * @param string $status * @return UpdatePaymentOptions Options builder */ public static function update( string $capture = Values::NONE, string $status = Values::NONE ): UpdatePaymentOptions { return new UpdatePaymentOptions( $capture, $status ); } } class CreatePaymentOptions extends Options { /** * @param string $bankAccountType * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. * @param string $paymentMethod * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. * @param string $tokenType * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` */ public function __construct( string $bankAccountType = Values::NONE, string $chargeAmount = Values::NONE, string $currency = Values::NONE, string $description = Values::NONE, string $input = Values::NONE, int $minPostalCodeLength = Values::INT_NONE, array $parameter = Values::ARRAY_NONE, string $paymentConnector = Values::NONE, string $paymentMethod = Values::NONE, bool $postalCode = Values::BOOL_NONE, bool $securityCode = Values::BOOL_NONE, int $timeout = Values::INT_NONE, string $tokenType = Values::NONE, string $validCardTypes = Values::NONE ) { $this->options['bankAccountType'] = $bankAccountType; $this->options['chargeAmount'] = $chargeAmount; $this->options['currency'] = $currency; $this->options['description'] = $description; $this->options['input'] = $input; $this->options['minPostalCodeLength'] = $minPostalCodeLength; $this->options['parameter'] = $parameter; $this->options['paymentConnector'] = $paymentConnector; $this->options['paymentMethod'] = $paymentMethod; $this->options['postalCode'] = $postalCode; $this->options['securityCode'] = $securityCode; $this->options['timeout'] = $timeout; $this->options['tokenType'] = $tokenType; $this->options['validCardTypes'] = $validCardTypes; } /** * @param string $bankAccountType * @return $this Fluent Builder */ public function setBankAccountType(string $bankAccountType): self { $this->options['bankAccountType'] = $bankAccountType; return $this; } /** * A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. * * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. * @return $this Fluent Builder */ public function setChargeAmount(string $chargeAmount): self { $this->options['chargeAmount'] = $chargeAmount; return $this; } /** * The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. * * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. * @return $this Fluent Builder */ public function setCurrency(string $currency): self { $this->options['currency'] = $currency; return $this; } /** * The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. * * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. * * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. * @return $this Fluent Builder */ public function setInput(string $input): self { $this->options['input'] = $input; return $this; } /** * A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. * * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. * @return $this Fluent Builder */ public function setMinPostalCodeLength(int $minPostalCodeLength): self { $this->options['minPostalCodeLength'] = $minPostalCodeLength; return $this; } /** * A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). * * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). * @return $this Fluent Builder */ public function setParameter(array $parameter): self { $this->options['parameter'] = $parameter; return $this; } /** * This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. * * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. * @return $this Fluent Builder */ public function setPaymentConnector(string $paymentConnector): self { $this->options['paymentConnector'] = $paymentConnector; return $this; } /** * @param string $paymentMethod * @return $this Fluent Builder */ public function setPaymentMethod(string $paymentMethod): self { $this->options['paymentMethod'] = $paymentMethod; return $this; } /** * Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. * * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. * @return $this Fluent Builder */ public function setPostalCode(bool $postalCode): self { $this->options['postalCode'] = $postalCode; return $this; } /** * Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. * * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. * @return $this Fluent Builder */ public function setSecurityCode(bool $securityCode): self { $this->options['securityCode'] = $securityCode; return $this; } /** * The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. * * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * @param string $tokenType * @return $this Fluent Builder */ public function setTokenType(string $tokenType): self { $this->options['tokenType'] = $tokenType; return $this; } /** * Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` * * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` * @return $this Fluent Builder */ public function setValidCardTypes(string $validCardTypes): self { $this->options['validCardTypes'] = $validCardTypes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreatePaymentOptions ' . $options . ']'; } } class UpdatePaymentOptions extends Options { /** * @param string $capture * @param string $status */ public function __construct( string $capture = Values::NONE, string $status = Values::NONE ) { $this->options['capture'] = $capture; $this->options['status'] = $status; } /** * @param string $capture * @return $this Fluent Builder */ public function setCapture(string $capture): self { $this->options['capture'] = $capture; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdatePaymentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventList.php000064400000012172150364341760016432 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Events.json'; } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EventPage Page of EventInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EventPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EventPage Page of EventInstance */ public function getPage(string $targetUrl): EventPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.EventList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryPage.php000064400000003160150364341760020351 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamPage.php000064400000003126150364341760016544 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackInstance.php000064400000010347150364341760017670 0ustar00properties = [ '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(); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php000064400000014040150364341760020112 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'uri' => Values::array_get($payload, 'uri'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), 'track' => Values::array_get($payload, 'track'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * Update the RecordingInstance * * @param string $status * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { return $this->proxy()->update($status, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php000064400000010352150364341760024307 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php000064400000007352150364341760020002 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Recordings/' . \rawurlencode($sid) .'.json'; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the RecordingInstance * * @param string $status * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { $options = new Values($options); $data = Values::of([ 'Status' => $status, 'PauseBehavior' => $options['pauseBehavior'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php000064400000011072150364341760016764 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Payments.json'; } /** * Create the PaymentInstance * * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback) * @param array|Options $options Optional Arguments * @return PaymentInstance Created PaymentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance { $options = new Values($options); $data = Values::of([ 'IdempotencyKey' => $idempotencyKey, 'StatusCallback' => $statusCallback, 'BankAccountType' => $options['bankAccountType'], 'ChargeAmount' => $options['chargeAmount'], 'Currency' => $options['currency'], 'Description' => $options['description'], 'Input' => $options['input'], 'MinPostalCodeLength' => $options['minPostalCodeLength'], 'Parameter' => Serialize::jsonObject($options['parameter']), 'PaymentConnector' => $options['paymentConnector'], 'PaymentMethod' => $options['paymentMethod'], 'PostalCode' => Serialize::booleanToString($options['postalCode']), 'SecurityCode' => Serialize::booleanToString($options['securityCode']), 'Timeout' => $options['timeout'], 'TokenType' => $options['tokenType'], 'ValidCardTypes' => $options['validCardTypes'], ]); $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 that needs to be updated. */ public function getContext( string $sid ): PaymentContext { return new PaymentContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.PaymentList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamInstance.php000064400000010304150364341760017430 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'name' => Values::array_get($payload, 'name'), 'status' => Values::array_get($payload, 'status'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return StreamContext Context for this StreamInstance */ protected function proxy(): StreamContext { if (!$this->context) { $this->context = new StreamContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the StreamInstance * * @param string $status * @return StreamInstance Updated StreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): StreamInstance { return $this->proxy()->update($status); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.StreamInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryContext.php000064400000005175150364341760021131 0ustar00solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/FeedbackSummary/' . \rawurlencode($sid) .'.json'; } /** * 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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php000064400000014725150364341760020005 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Notifications.json'; } /** * Reads NotificationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NotificationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams NotificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NotificationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NotificationPage Page of NotificationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NotificationPage { $options = new Values($options); $params = Values::of([ 'Log' => $options['log'], 'MessageDate<' => Serialize::iso8601Date($options['messageDateBefore']), 'MessageDate' => Serialize::iso8601Date($options['messageDate']), 'MessageDate>' => Serialize::iso8601Date($options['messageDateAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NotificationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NotificationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NotificationPage Page of NotificationInstance */ public function getPage(string $targetUrl): NotificationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NotificationPage($this->version, $response, $this->solution); } /** * Constructs a NotificationContext * * @param string $sid The Twilio-provided string that uniquely identifies the Call Notification resource to fetch. */ public function getContext( string $sid ): NotificationContext { return new NotificationContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NotificationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamContext.php000064400000005354150364341760017321 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Streams/' . \rawurlencode($sid) .'.json'; } /** * Update the StreamInstance * * @param string $status * @return StreamInstance Updated StreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): StreamInstance { $data = Values::of([ 'Status' => $status, ]); $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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamOptions.php000064400000360601150364341760017327 0ustar00options['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 user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. * @return $this Fluent Builder */ public function setName(string $name): self { $this->options['name'] = $name; return $this; } /** * @param string $track * @return $this Fluent Builder */ public function setTrack(string $track): self { $this->options['track'] = $track; return $this; } /** * Absolute URL of the status callback. * * @param string $statusCallback Absolute URL of the status callback. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The http method for the status_callback (one of GET, POST). * * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Parameter name * * @param string $parameter1Name Parameter name * @return $this Fluent Builder */ public function setParameter1Name(string $parameter1Name): self { $this->options['parameter1Name'] = $parameter1Name; return $this; } /** * Parameter value * * @param string $parameter1Value Parameter value * @return $this Fluent Builder */ public function setParameter1Value(string $parameter1Value): self { $this->options['parameter1Value'] = $parameter1Value; return $this; } /** * Parameter name * * @param string $parameter2Name Parameter name * @return $this Fluent Builder */ public function setParameter2Name(string $parameter2Name): self { $this->options['parameter2Name'] = $parameter2Name; return $this; } /** * Parameter value * * @param string $parameter2Value Parameter value * @return $this Fluent Builder */ public function setParameter2Value(string $parameter2Value): self { $this->options['parameter2Value'] = $parameter2Value; return $this; } /** * Parameter name * * @param string $parameter3Name Parameter name * @return $this Fluent Builder */ public function setParameter3Name(string $parameter3Name): self { $this->options['parameter3Name'] = $parameter3Name; return $this; } /** * Parameter value * * @param string $parameter3Value Parameter value * @return $this Fluent Builder */ public function setParameter3Value(string $parameter3Value): self { $this->options['parameter3Value'] = $parameter3Value; return $this; } /** * Parameter name * * @param string $parameter4Name Parameter name * @return $this Fluent Builder */ public function setParameter4Name(string $parameter4Name): self { $this->options['parameter4Name'] = $parameter4Name; return $this; } /** * Parameter value * * @param string $parameter4Value Parameter value * @return $this Fluent Builder */ public function setParameter4Value(string $parameter4Value): self { $this->options['parameter4Value'] = $parameter4Value; return $this; } /** * Parameter name * * @param string $parameter5Name Parameter name * @return $this Fluent Builder */ public function setParameter5Name(string $parameter5Name): self { $this->options['parameter5Name'] = $parameter5Name; return $this; } /** * Parameter value * * @param string $parameter5Value Parameter value * @return $this Fluent Builder */ public function setParameter5Value(string $parameter5Value): self { $this->options['parameter5Value'] = $parameter5Value; return $this; } /** * Parameter name * * @param string $parameter6Name Parameter name * @return $this Fluent Builder */ public function setParameter6Name(string $parameter6Name): self { $this->options['parameter6Name'] = $parameter6Name; return $this; } /** * Parameter value * * @param string $parameter6Value Parameter value * @return $this Fluent Builder */ public function setParameter6Value(string $parameter6Value): self { $this->options['parameter6Value'] = $parameter6Value; return $this; } /** * Parameter name * * @param string $parameter7Name Parameter name * @return $this Fluent Builder */ public function setParameter7Name(string $parameter7Name): self { $this->options['parameter7Name'] = $parameter7Name; return $this; } /** * Parameter value * * @param string $parameter7Value Parameter value * @return $this Fluent Builder */ public function setParameter7Value(string $parameter7Value): self { $this->options['parameter7Value'] = $parameter7Value; return $this; } /** * Parameter name * * @param string $parameter8Name Parameter name * @return $this Fluent Builder */ public function setParameter8Name(string $parameter8Name): self { $this->options['parameter8Name'] = $parameter8Name; return $this; } /** * Parameter value * * @param string $parameter8Value Parameter value * @return $this Fluent Builder */ public function setParameter8Value(string $parameter8Value): self { $this->options['parameter8Value'] = $parameter8Value; return $this; } /** * Parameter name * * @param string $parameter9Name Parameter name * @return $this Fluent Builder */ public function setParameter9Name(string $parameter9Name): self { $this->options['parameter9Name'] = $parameter9Name; return $this; } /** * Parameter value * * @param string $parameter9Value Parameter value * @return $this Fluent Builder */ public function setParameter9Value(string $parameter9Value): self { $this->options['parameter9Value'] = $parameter9Value; return $this; } /** * Parameter name * * @param string $parameter10Name Parameter name * @return $this Fluent Builder */ public function setParameter10Name(string $parameter10Name): self { $this->options['parameter10Name'] = $parameter10Name; return $this; } /** * Parameter value * * @param string $parameter10Value Parameter value * @return $this Fluent Builder */ public function setParameter10Value(string $parameter10Value): self { $this->options['parameter10Value'] = $parameter10Value; return $this; } /** * Parameter name * * @param string $parameter11Name Parameter name * @return $this Fluent Builder */ public function setParameter11Name(string $parameter11Name): self { $this->options['parameter11Name'] = $parameter11Name; return $this; } /** * Parameter value * * @param string $parameter11Value Parameter value * @return $this Fluent Builder */ public function setParameter11Value(string $parameter11Value): self { $this->options['parameter11Value'] = $parameter11Value; return $this; } /** * Parameter name * * @param string $parameter12Name Parameter name * @return $this Fluent Builder */ public function setParameter12Name(string $parameter12Name): self { $this->options['parameter12Name'] = $parameter12Name; return $this; } /** * Parameter value * * @param string $parameter12Value Parameter value * @return $this Fluent Builder */ public function setParameter12Value(string $parameter12Value): self { $this->options['parameter12Value'] = $parameter12Value; return $this; } /** * Parameter name * * @param string $parameter13Name Parameter name * @return $this Fluent Builder */ public function setParameter13Name(string $parameter13Name): self { $this->options['parameter13Name'] = $parameter13Name; return $this; } /** * Parameter value * * @param string $parameter13Value Parameter value * @return $this Fluent Builder */ public function setParameter13Value(string $parameter13Value): self { $this->options['parameter13Value'] = $parameter13Value; return $this; } /** * Parameter name * * @param string $parameter14Name Parameter name * @return $this Fluent Builder */ public function setParameter14Name(string $parameter14Name): self { $this->options['parameter14Name'] = $parameter14Name; return $this; } /** * Parameter value * * @param string $parameter14Value Parameter value * @return $this Fluent Builder */ public function setParameter14Value(string $parameter14Value): self { $this->options['parameter14Value'] = $parameter14Value; return $this; } /** * Parameter name * * @param string $parameter15Name Parameter name * @return $this Fluent Builder */ public function setParameter15Name(string $parameter15Name): self { $this->options['parameter15Name'] = $parameter15Name; return $this; } /** * Parameter value * * @param string $parameter15Value Parameter value * @return $this Fluent Builder */ public function setParameter15Value(string $parameter15Value): self { $this->options['parameter15Value'] = $parameter15Value; return $this; } /** * Parameter name * * @param string $parameter16Name Parameter name * @return $this Fluent Builder */ public function setParameter16Name(string $parameter16Name): self { $this->options['parameter16Name'] = $parameter16Name; return $this; } /** * Parameter value * * @param string $parameter16Value Parameter value * @return $this Fluent Builder */ public function setParameter16Value(string $parameter16Value): self { $this->options['parameter16Value'] = $parameter16Value; return $this; } /** * Parameter name * * @param string $parameter17Name Parameter name * @return $this Fluent Builder */ public function setParameter17Name(string $parameter17Name): self { $this->options['parameter17Name'] = $parameter17Name; return $this; } /** * Parameter value * * @param string $parameter17Value Parameter value * @return $this Fluent Builder */ public function setParameter17Value(string $parameter17Value): self { $this->options['parameter17Value'] = $parameter17Value; return $this; } /** * Parameter name * * @param string $parameter18Name Parameter name * @return $this Fluent Builder */ public function setParameter18Name(string $parameter18Name): self { $this->options['parameter18Name'] = $parameter18Name; return $this; } /** * Parameter value * * @param string $parameter18Value Parameter value * @return $this Fluent Builder */ public function setParameter18Value(string $parameter18Value): self { $this->options['parameter18Value'] = $parameter18Value; return $this; } /** * Parameter name * * @param string $parameter19Name Parameter name * @return $this Fluent Builder */ public function setParameter19Name(string $parameter19Name): self { $this->options['parameter19Name'] = $parameter19Name; return $this; } /** * Parameter value * * @param string $parameter19Value Parameter value * @return $this Fluent Builder */ public function setParameter19Value(string $parameter19Value): self { $this->options['parameter19Value'] = $parameter19Value; return $this; } /** * Parameter name * * @param string $parameter20Name Parameter name * @return $this Fluent Builder */ public function setParameter20Name(string $parameter20Name): self { $this->options['parameter20Name'] = $parameter20Name; return $this; } /** * Parameter value * * @param string $parameter20Value Parameter value * @return $this Fluent Builder */ public function setParameter20Value(string $parameter20Value): self { $this->options['parameter20Value'] = $parameter20Value; return $this; } /** * Parameter name * * @param string $parameter21Name Parameter name * @return $this Fluent Builder */ public function setParameter21Name(string $parameter21Name): self { $this->options['parameter21Name'] = $parameter21Name; return $this; } /** * Parameter value * * @param string $parameter21Value Parameter value * @return $this Fluent Builder */ public function setParameter21Value(string $parameter21Value): self { $this->options['parameter21Value'] = $parameter21Value; return $this; } /** * Parameter name * * @param string $parameter22Name Parameter name * @return $this Fluent Builder */ public function setParameter22Name(string $parameter22Name): self { $this->options['parameter22Name'] = $parameter22Name; return $this; } /** * Parameter value * * @param string $parameter22Value Parameter value * @return $this Fluent Builder */ public function setParameter22Value(string $parameter22Value): self { $this->options['parameter22Value'] = $parameter22Value; return $this; } /** * Parameter name * * @param string $parameter23Name Parameter name * @return $this Fluent Builder */ public function setParameter23Name(string $parameter23Name): self { $this->options['parameter23Name'] = $parameter23Name; return $this; } /** * Parameter value * * @param string $parameter23Value Parameter value * @return $this Fluent Builder */ public function setParameter23Value(string $parameter23Value): self { $this->options['parameter23Value'] = $parameter23Value; return $this; } /** * Parameter name * * @param string $parameter24Name Parameter name * @return $this Fluent Builder */ public function setParameter24Name(string $parameter24Name): self { $this->options['parameter24Name'] = $parameter24Name; return $this; } /** * Parameter value * * @param string $parameter24Value Parameter value * @return $this Fluent Builder */ public function setParameter24Value(string $parameter24Value): self { $this->options['parameter24Value'] = $parameter24Value; return $this; } /** * Parameter name * * @param string $parameter25Name Parameter name * @return $this Fluent Builder */ public function setParameter25Name(string $parameter25Name): self { $this->options['parameter25Name'] = $parameter25Name; return $this; } /** * Parameter value * * @param string $parameter25Value Parameter value * @return $this Fluent Builder */ public function setParameter25Value(string $parameter25Value): self { $this->options['parameter25Value'] = $parameter25Value; return $this; } /** * Parameter name * * @param string $parameter26Name Parameter name * @return $this Fluent Builder */ public function setParameter26Name(string $parameter26Name): self { $this->options['parameter26Name'] = $parameter26Name; return $this; } /** * Parameter value * * @param string $parameter26Value Parameter value * @return $this Fluent Builder */ public function setParameter26Value(string $parameter26Value): self { $this->options['parameter26Value'] = $parameter26Value; return $this; } /** * Parameter name * * @param string $parameter27Name Parameter name * @return $this Fluent Builder */ public function setParameter27Name(string $parameter27Name): self { $this->options['parameter27Name'] = $parameter27Name; return $this; } /** * Parameter value * * @param string $parameter27Value Parameter value * @return $this Fluent Builder */ public function setParameter27Value(string $parameter27Value): self { $this->options['parameter27Value'] = $parameter27Value; return $this; } /** * Parameter name * * @param string $parameter28Name Parameter name * @return $this Fluent Builder */ public function setParameter28Name(string $parameter28Name): self { $this->options['parameter28Name'] = $parameter28Name; return $this; } /** * Parameter value * * @param string $parameter28Value Parameter value * @return $this Fluent Builder */ public function setParameter28Value(string $parameter28Value): self { $this->options['parameter28Value'] = $parameter28Value; return $this; } /** * Parameter name * * @param string $parameter29Name Parameter name * @return $this Fluent Builder */ public function setParameter29Name(string $parameter29Name): self { $this->options['parameter29Name'] = $parameter29Name; return $this; } /** * Parameter value * * @param string $parameter29Value Parameter value * @return $this Fluent Builder */ public function setParameter29Value(string $parameter29Value): self { $this->options['parameter29Value'] = $parameter29Value; return $this; } /** * Parameter name * * @param string $parameter30Name Parameter name * @return $this Fluent Builder */ public function setParameter30Name(string $parameter30Name): self { $this->options['parameter30Name'] = $parameter30Name; return $this; } /** * Parameter value * * @param string $parameter30Value Parameter value * @return $this Fluent Builder */ public function setParameter30Value(string $parameter30Value): self { $this->options['parameter30Value'] = $parameter30Value; return $this; } /** * Parameter name * * @param string $parameter31Name Parameter name * @return $this Fluent Builder */ public function setParameter31Name(string $parameter31Name): self { $this->options['parameter31Name'] = $parameter31Name; return $this; } /** * Parameter value * * @param string $parameter31Value Parameter value * @return $this Fluent Builder */ public function setParameter31Value(string $parameter31Value): self { $this->options['parameter31Value'] = $parameter31Value; return $this; } /** * Parameter name * * @param string $parameter32Name Parameter name * @return $this Fluent Builder */ public function setParameter32Name(string $parameter32Name): self { $this->options['parameter32Name'] = $parameter32Name; return $this; } /** * Parameter value * * @param string $parameter32Value Parameter value * @return $this Fluent Builder */ public function setParameter32Value(string $parameter32Value): self { $this->options['parameter32Value'] = $parameter32Value; return $this; } /** * Parameter name * * @param string $parameter33Name Parameter name * @return $this Fluent Builder */ public function setParameter33Name(string $parameter33Name): self { $this->options['parameter33Name'] = $parameter33Name; return $this; } /** * Parameter value * * @param string $parameter33Value Parameter value * @return $this Fluent Builder */ public function setParameter33Value(string $parameter33Value): self { $this->options['parameter33Value'] = $parameter33Value; return $this; } /** * Parameter name * * @param string $parameter34Name Parameter name * @return $this Fluent Builder */ public function setParameter34Name(string $parameter34Name): self { $this->options['parameter34Name'] = $parameter34Name; return $this; } /** * Parameter value * * @param string $parameter34Value Parameter value * @return $this Fluent Builder */ public function setParameter34Value(string $parameter34Value): self { $this->options['parameter34Value'] = $parameter34Value; return $this; } /** * Parameter name * * @param string $parameter35Name Parameter name * @return $this Fluent Builder */ public function setParameter35Name(string $parameter35Name): self { $this->options['parameter35Name'] = $parameter35Name; return $this; } /** * Parameter value * * @param string $parameter35Value Parameter value * @return $this Fluent Builder */ public function setParameter35Value(string $parameter35Value): self { $this->options['parameter35Value'] = $parameter35Value; return $this; } /** * Parameter name * * @param string $parameter36Name Parameter name * @return $this Fluent Builder */ public function setParameter36Name(string $parameter36Name): self { $this->options['parameter36Name'] = $parameter36Name; return $this; } /** * Parameter value * * @param string $parameter36Value Parameter value * @return $this Fluent Builder */ public function setParameter36Value(string $parameter36Value): self { $this->options['parameter36Value'] = $parameter36Value; return $this; } /** * Parameter name * * @param string $parameter37Name Parameter name * @return $this Fluent Builder */ public function setParameter37Name(string $parameter37Name): self { $this->options['parameter37Name'] = $parameter37Name; return $this; } /** * Parameter value * * @param string $parameter37Value Parameter value * @return $this Fluent Builder */ public function setParameter37Value(string $parameter37Value): self { $this->options['parameter37Value'] = $parameter37Value; return $this; } /** * Parameter name * * @param string $parameter38Name Parameter name * @return $this Fluent Builder */ public function setParameter38Name(string $parameter38Name): self { $this->options['parameter38Name'] = $parameter38Name; return $this; } /** * Parameter value * * @param string $parameter38Value Parameter value * @return $this Fluent Builder */ public function setParameter38Value(string $parameter38Value): self { $this->options['parameter38Value'] = $parameter38Value; return $this; } /** * Parameter name * * @param string $parameter39Name Parameter name * @return $this Fluent Builder */ public function setParameter39Name(string $parameter39Name): self { $this->options['parameter39Name'] = $parameter39Name; return $this; } /** * Parameter value * * @param string $parameter39Value Parameter value * @return $this Fluent Builder */ public function setParameter39Value(string $parameter39Value): self { $this->options['parameter39Value'] = $parameter39Value; return $this; } /** * Parameter name * * @param string $parameter40Name Parameter name * @return $this Fluent Builder */ public function setParameter40Name(string $parameter40Name): self { $this->options['parameter40Name'] = $parameter40Name; return $this; } /** * Parameter value * * @param string $parameter40Value Parameter value * @return $this Fluent Builder */ public function setParameter40Value(string $parameter40Value): self { $this->options['parameter40Value'] = $parameter40Value; return $this; } /** * Parameter name * * @param string $parameter41Name Parameter name * @return $this Fluent Builder */ public function setParameter41Name(string $parameter41Name): self { $this->options['parameter41Name'] = $parameter41Name; return $this; } /** * Parameter value * * @param string $parameter41Value Parameter value * @return $this Fluent Builder */ public function setParameter41Value(string $parameter41Value): self { $this->options['parameter41Value'] = $parameter41Value; return $this; } /** * Parameter name * * @param string $parameter42Name Parameter name * @return $this Fluent Builder */ public function setParameter42Name(string $parameter42Name): self { $this->options['parameter42Name'] = $parameter42Name; return $this; } /** * Parameter value * * @param string $parameter42Value Parameter value * @return $this Fluent Builder */ public function setParameter42Value(string $parameter42Value): self { $this->options['parameter42Value'] = $parameter42Value; return $this; } /** * Parameter name * * @param string $parameter43Name Parameter name * @return $this Fluent Builder */ public function setParameter43Name(string $parameter43Name): self { $this->options['parameter43Name'] = $parameter43Name; return $this; } /** * Parameter value * * @param string $parameter43Value Parameter value * @return $this Fluent Builder */ public function setParameter43Value(string $parameter43Value): self { $this->options['parameter43Value'] = $parameter43Value; return $this; } /** * Parameter name * * @param string $parameter44Name Parameter name * @return $this Fluent Builder */ public function setParameter44Name(string $parameter44Name): self { $this->options['parameter44Name'] = $parameter44Name; return $this; } /** * Parameter value * * @param string $parameter44Value Parameter value * @return $this Fluent Builder */ public function setParameter44Value(string $parameter44Value): self { $this->options['parameter44Value'] = $parameter44Value; return $this; } /** * Parameter name * * @param string $parameter45Name Parameter name * @return $this Fluent Builder */ public function setParameter45Name(string $parameter45Name): self { $this->options['parameter45Name'] = $parameter45Name; return $this; } /** * Parameter value * * @param string $parameter45Value Parameter value * @return $this Fluent Builder */ public function setParameter45Value(string $parameter45Value): self { $this->options['parameter45Value'] = $parameter45Value; return $this; } /** * Parameter name * * @param string $parameter46Name Parameter name * @return $this Fluent Builder */ public function setParameter46Name(string $parameter46Name): self { $this->options['parameter46Name'] = $parameter46Name; return $this; } /** * Parameter value * * @param string $parameter46Value Parameter value * @return $this Fluent Builder */ public function setParameter46Value(string $parameter46Value): self { $this->options['parameter46Value'] = $parameter46Value; return $this; } /** * Parameter name * * @param string $parameter47Name Parameter name * @return $this Fluent Builder */ public function setParameter47Name(string $parameter47Name): self { $this->options['parameter47Name'] = $parameter47Name; return $this; } /** * Parameter value * * @param string $parameter47Value Parameter value * @return $this Fluent Builder */ public function setParameter47Value(string $parameter47Value): self { $this->options['parameter47Value'] = $parameter47Value; return $this; } /** * Parameter name * * @param string $parameter48Name Parameter name * @return $this Fluent Builder */ public function setParameter48Name(string $parameter48Name): self { $this->options['parameter48Name'] = $parameter48Name; return $this; } /** * Parameter value * * @param string $parameter48Value Parameter value * @return $this Fluent Builder */ public function setParameter48Value(string $parameter48Value): self { $this->options['parameter48Value'] = $parameter48Value; return $this; } /** * Parameter name * * @param string $parameter49Name Parameter name * @return $this Fluent Builder */ public function setParameter49Name(string $parameter49Name): self { $this->options['parameter49Name'] = $parameter49Name; return $this; } /** * Parameter value * * @param string $parameter49Value Parameter value * @return $this Fluent Builder */ public function setParameter49Value(string $parameter49Value): self { $this->options['parameter49Value'] = $parameter49Value; return $this; } /** * Parameter name * * @param string $parameter50Name Parameter name * @return $this Fluent Builder */ public function setParameter50Name(string $parameter50Name): self { $this->options['parameter50Name'] = $parameter50Name; return $this; } /** * Parameter value * * @param string $parameter50Value Parameter value * @return $this Fluent Builder */ public function setParameter50Value(string $parameter50Value): self { $this->options['parameter50Value'] = $parameter50Value; return $this; } /** * Parameter name * * @param string $parameter51Name Parameter name * @return $this Fluent Builder */ public function setParameter51Name(string $parameter51Name): self { $this->options['parameter51Name'] = $parameter51Name; return $this; } /** * Parameter value * * @param string $parameter51Value Parameter value * @return $this Fluent Builder */ public function setParameter51Value(string $parameter51Value): self { $this->options['parameter51Value'] = $parameter51Value; return $this; } /** * Parameter name * * @param string $parameter52Name Parameter name * @return $this Fluent Builder */ public function setParameter52Name(string $parameter52Name): self { $this->options['parameter52Name'] = $parameter52Name; return $this; } /** * Parameter value * * @param string $parameter52Value Parameter value * @return $this Fluent Builder */ public function setParameter52Value(string $parameter52Value): self { $this->options['parameter52Value'] = $parameter52Value; return $this; } /** * Parameter name * * @param string $parameter53Name Parameter name * @return $this Fluent Builder */ public function setParameter53Name(string $parameter53Name): self { $this->options['parameter53Name'] = $parameter53Name; return $this; } /** * Parameter value * * @param string $parameter53Value Parameter value * @return $this Fluent Builder */ public function setParameter53Value(string $parameter53Value): self { $this->options['parameter53Value'] = $parameter53Value; return $this; } /** * Parameter name * * @param string $parameter54Name Parameter name * @return $this Fluent Builder */ public function setParameter54Name(string $parameter54Name): self { $this->options['parameter54Name'] = $parameter54Name; return $this; } /** * Parameter value * * @param string $parameter54Value Parameter value * @return $this Fluent Builder */ public function setParameter54Value(string $parameter54Value): self { $this->options['parameter54Value'] = $parameter54Value; return $this; } /** * Parameter name * * @param string $parameter55Name Parameter name * @return $this Fluent Builder */ public function setParameter55Name(string $parameter55Name): self { $this->options['parameter55Name'] = $parameter55Name; return $this; } /** * Parameter value * * @param string $parameter55Value Parameter value * @return $this Fluent Builder */ public function setParameter55Value(string $parameter55Value): self { $this->options['parameter55Value'] = $parameter55Value; return $this; } /** * Parameter name * * @param string $parameter56Name Parameter name * @return $this Fluent Builder */ public function setParameter56Name(string $parameter56Name): self { $this->options['parameter56Name'] = $parameter56Name; return $this; } /** * Parameter value * * @param string $parameter56Value Parameter value * @return $this Fluent Builder */ public function setParameter56Value(string $parameter56Value): self { $this->options['parameter56Value'] = $parameter56Value; return $this; } /** * Parameter name * * @param string $parameter57Name Parameter name * @return $this Fluent Builder */ public function setParameter57Name(string $parameter57Name): self { $this->options['parameter57Name'] = $parameter57Name; return $this; } /** * Parameter value * * @param string $parameter57Value Parameter value * @return $this Fluent Builder */ public function setParameter57Value(string $parameter57Value): self { $this->options['parameter57Value'] = $parameter57Value; return $this; } /** * Parameter name * * @param string $parameter58Name Parameter name * @return $this Fluent Builder */ public function setParameter58Name(string $parameter58Name): self { $this->options['parameter58Name'] = $parameter58Name; return $this; } /** * Parameter value * * @param string $parameter58Value Parameter value * @return $this Fluent Builder */ public function setParameter58Value(string $parameter58Value): self { $this->options['parameter58Value'] = $parameter58Value; return $this; } /** * Parameter name * * @param string $parameter59Name Parameter name * @return $this Fluent Builder */ public function setParameter59Name(string $parameter59Name): self { $this->options['parameter59Name'] = $parameter59Name; return $this; } /** * Parameter value * * @param string $parameter59Value Parameter value * @return $this Fluent Builder */ public function setParameter59Value(string $parameter59Value): self { $this->options['parameter59Value'] = $parameter59Value; return $this; } /** * Parameter name * * @param string $parameter60Name Parameter name * @return $this Fluent Builder */ public function setParameter60Name(string $parameter60Name): self { $this->options['parameter60Name'] = $parameter60Name; return $this; } /** * Parameter value * * @param string $parameter60Value Parameter value * @return $this Fluent Builder */ public function setParameter60Value(string $parameter60Value): self { $this->options['parameter60Value'] = $parameter60Value; return $this; } /** * Parameter name * * @param string $parameter61Name Parameter name * @return $this Fluent Builder */ public function setParameter61Name(string $parameter61Name): self { $this->options['parameter61Name'] = $parameter61Name; return $this; } /** * Parameter value * * @param string $parameter61Value Parameter value * @return $this Fluent Builder */ public function setParameter61Value(string $parameter61Value): self { $this->options['parameter61Value'] = $parameter61Value; return $this; } /** * Parameter name * * @param string $parameter62Name Parameter name * @return $this Fluent Builder */ public function setParameter62Name(string $parameter62Name): self { $this->options['parameter62Name'] = $parameter62Name; return $this; } /** * Parameter value * * @param string $parameter62Value Parameter value * @return $this Fluent Builder */ public function setParameter62Value(string $parameter62Value): self { $this->options['parameter62Value'] = $parameter62Value; return $this; } /** * Parameter name * * @param string $parameter63Name Parameter name * @return $this Fluent Builder */ public function setParameter63Name(string $parameter63Name): self { $this->options['parameter63Name'] = $parameter63Name; return $this; } /** * Parameter value * * @param string $parameter63Value Parameter value * @return $this Fluent Builder */ public function setParameter63Value(string $parameter63Value): self { $this->options['parameter63Value'] = $parameter63Value; return $this; } /** * Parameter name * * @param string $parameter64Name Parameter name * @return $this Fluent Builder */ public function setParameter64Name(string $parameter64Name): self { $this->options['parameter64Name'] = $parameter64Name; return $this; } /** * Parameter value * * @param string $parameter64Value Parameter value * @return $this Fluent Builder */ public function setParameter64Value(string $parameter64Value): self { $this->options['parameter64Value'] = $parameter64Value; return $this; } /** * Parameter name * * @param string $parameter65Name Parameter name * @return $this Fluent Builder */ public function setParameter65Name(string $parameter65Name): self { $this->options['parameter65Name'] = $parameter65Name; return $this; } /** * Parameter value * * @param string $parameter65Value Parameter value * @return $this Fluent Builder */ public function setParameter65Value(string $parameter65Value): self { $this->options['parameter65Value'] = $parameter65Value; return $this; } /** * Parameter name * * @param string $parameter66Name Parameter name * @return $this Fluent Builder */ public function setParameter66Name(string $parameter66Name): self { $this->options['parameter66Name'] = $parameter66Name; return $this; } /** * Parameter value * * @param string $parameter66Value Parameter value * @return $this Fluent Builder */ public function setParameter66Value(string $parameter66Value): self { $this->options['parameter66Value'] = $parameter66Value; return $this; } /** * Parameter name * * @param string $parameter67Name Parameter name * @return $this Fluent Builder */ public function setParameter67Name(string $parameter67Name): self { $this->options['parameter67Name'] = $parameter67Name; return $this; } /** * Parameter value * * @param string $parameter67Value Parameter value * @return $this Fluent Builder */ public function setParameter67Value(string $parameter67Value): self { $this->options['parameter67Value'] = $parameter67Value; return $this; } /** * Parameter name * * @param string $parameter68Name Parameter name * @return $this Fluent Builder */ public function setParameter68Name(string $parameter68Name): self { $this->options['parameter68Name'] = $parameter68Name; return $this; } /** * Parameter value * * @param string $parameter68Value Parameter value * @return $this Fluent Builder */ public function setParameter68Value(string $parameter68Value): self { $this->options['parameter68Value'] = $parameter68Value; return $this; } /** * Parameter name * * @param string $parameter69Name Parameter name * @return $this Fluent Builder */ public function setParameter69Name(string $parameter69Name): self { $this->options['parameter69Name'] = $parameter69Name; return $this; } /** * Parameter value * * @param string $parameter69Value Parameter value * @return $this Fluent Builder */ public function setParameter69Value(string $parameter69Value): self { $this->options['parameter69Value'] = $parameter69Value; return $this; } /** * Parameter name * * @param string $parameter70Name Parameter name * @return $this Fluent Builder */ public function setParameter70Name(string $parameter70Name): self { $this->options['parameter70Name'] = $parameter70Name; return $this; } /** * Parameter value * * @param string $parameter70Value Parameter value * @return $this Fluent Builder */ public function setParameter70Value(string $parameter70Value): self { $this->options['parameter70Value'] = $parameter70Value; return $this; } /** * Parameter name * * @param string $parameter71Name Parameter name * @return $this Fluent Builder */ public function setParameter71Name(string $parameter71Name): self { $this->options['parameter71Name'] = $parameter71Name; return $this; } /** * Parameter value * * @param string $parameter71Value Parameter value * @return $this Fluent Builder */ public function setParameter71Value(string $parameter71Value): self { $this->options['parameter71Value'] = $parameter71Value; return $this; } /** * Parameter name * * @param string $parameter72Name Parameter name * @return $this Fluent Builder */ public function setParameter72Name(string $parameter72Name): self { $this->options['parameter72Name'] = $parameter72Name; return $this; } /** * Parameter value * * @param string $parameter72Value Parameter value * @return $this Fluent Builder */ public function setParameter72Value(string $parameter72Value): self { $this->options['parameter72Value'] = $parameter72Value; return $this; } /** * Parameter name * * @param string $parameter73Name Parameter name * @return $this Fluent Builder */ public function setParameter73Name(string $parameter73Name): self { $this->options['parameter73Name'] = $parameter73Name; return $this; } /** * Parameter value * * @param string $parameter73Value Parameter value * @return $this Fluent Builder */ public function setParameter73Value(string $parameter73Value): self { $this->options['parameter73Value'] = $parameter73Value; return $this; } /** * Parameter name * * @param string $parameter74Name Parameter name * @return $this Fluent Builder */ public function setParameter74Name(string $parameter74Name): self { $this->options['parameter74Name'] = $parameter74Name; return $this; } /** * Parameter value * * @param string $parameter74Value Parameter value * @return $this Fluent Builder */ public function setParameter74Value(string $parameter74Value): self { $this->options['parameter74Value'] = $parameter74Value; return $this; } /** * Parameter name * * @param string $parameter75Name Parameter name * @return $this Fluent Builder */ public function setParameter75Name(string $parameter75Name): self { $this->options['parameter75Name'] = $parameter75Name; return $this; } /** * Parameter value * * @param string $parameter75Value Parameter value * @return $this Fluent Builder */ public function setParameter75Value(string $parameter75Value): self { $this->options['parameter75Value'] = $parameter75Value; return $this; } /** * Parameter name * * @param string $parameter76Name Parameter name * @return $this Fluent Builder */ public function setParameter76Name(string $parameter76Name): self { $this->options['parameter76Name'] = $parameter76Name; return $this; } /** * Parameter value * * @param string $parameter76Value Parameter value * @return $this Fluent Builder */ public function setParameter76Value(string $parameter76Value): self { $this->options['parameter76Value'] = $parameter76Value; return $this; } /** * Parameter name * * @param string $parameter77Name Parameter name * @return $this Fluent Builder */ public function setParameter77Name(string $parameter77Name): self { $this->options['parameter77Name'] = $parameter77Name; return $this; } /** * Parameter value * * @param string $parameter77Value Parameter value * @return $this Fluent Builder */ public function setParameter77Value(string $parameter77Value): self { $this->options['parameter77Value'] = $parameter77Value; return $this; } /** * Parameter name * * @param string $parameter78Name Parameter name * @return $this Fluent Builder */ public function setParameter78Name(string $parameter78Name): self { $this->options['parameter78Name'] = $parameter78Name; return $this; } /** * Parameter value * * @param string $parameter78Value Parameter value * @return $this Fluent Builder */ public function setParameter78Value(string $parameter78Value): self { $this->options['parameter78Value'] = $parameter78Value; return $this; } /** * Parameter name * * @param string $parameter79Name Parameter name * @return $this Fluent Builder */ public function setParameter79Name(string $parameter79Name): self { $this->options['parameter79Name'] = $parameter79Name; return $this; } /** * Parameter value * * @param string $parameter79Value Parameter value * @return $this Fluent Builder */ public function setParameter79Value(string $parameter79Value): self { $this->options['parameter79Value'] = $parameter79Value; return $this; } /** * Parameter name * * @param string $parameter80Name Parameter name * @return $this Fluent Builder */ public function setParameter80Name(string $parameter80Name): self { $this->options['parameter80Name'] = $parameter80Name; return $this; } /** * Parameter value * * @param string $parameter80Value Parameter value * @return $this Fluent Builder */ public function setParameter80Value(string $parameter80Value): self { $this->options['parameter80Value'] = $parameter80Value; return $this; } /** * Parameter name * * @param string $parameter81Name Parameter name * @return $this Fluent Builder */ public function setParameter81Name(string $parameter81Name): self { $this->options['parameter81Name'] = $parameter81Name; return $this; } /** * Parameter value * * @param string $parameter81Value Parameter value * @return $this Fluent Builder */ public function setParameter81Value(string $parameter81Value): self { $this->options['parameter81Value'] = $parameter81Value; return $this; } /** * Parameter name * * @param string $parameter82Name Parameter name * @return $this Fluent Builder */ public function setParameter82Name(string $parameter82Name): self { $this->options['parameter82Name'] = $parameter82Name; return $this; } /** * Parameter value * * @param string $parameter82Value Parameter value * @return $this Fluent Builder */ public function setParameter82Value(string $parameter82Value): self { $this->options['parameter82Value'] = $parameter82Value; return $this; } /** * Parameter name * * @param string $parameter83Name Parameter name * @return $this Fluent Builder */ public function setParameter83Name(string $parameter83Name): self { $this->options['parameter83Name'] = $parameter83Name; return $this; } /** * Parameter value * * @param string $parameter83Value Parameter value * @return $this Fluent Builder */ public function setParameter83Value(string $parameter83Value): self { $this->options['parameter83Value'] = $parameter83Value; return $this; } /** * Parameter name * * @param string $parameter84Name Parameter name * @return $this Fluent Builder */ public function setParameter84Name(string $parameter84Name): self { $this->options['parameter84Name'] = $parameter84Name; return $this; } /** * Parameter value * * @param string $parameter84Value Parameter value * @return $this Fluent Builder */ public function setParameter84Value(string $parameter84Value): self { $this->options['parameter84Value'] = $parameter84Value; return $this; } /** * Parameter name * * @param string $parameter85Name Parameter name * @return $this Fluent Builder */ public function setParameter85Name(string $parameter85Name): self { $this->options['parameter85Name'] = $parameter85Name; return $this; } /** * Parameter value * * @param string $parameter85Value Parameter value * @return $this Fluent Builder */ public function setParameter85Value(string $parameter85Value): self { $this->options['parameter85Value'] = $parameter85Value; return $this; } /** * Parameter name * * @param string $parameter86Name Parameter name * @return $this Fluent Builder */ public function setParameter86Name(string $parameter86Name): self { $this->options['parameter86Name'] = $parameter86Name; return $this; } /** * Parameter value * * @param string $parameter86Value Parameter value * @return $this Fluent Builder */ public function setParameter86Value(string $parameter86Value): self { $this->options['parameter86Value'] = $parameter86Value; return $this; } /** * Parameter name * * @param string $parameter87Name Parameter name * @return $this Fluent Builder */ public function setParameter87Name(string $parameter87Name): self { $this->options['parameter87Name'] = $parameter87Name; return $this; } /** * Parameter value * * @param string $parameter87Value Parameter value * @return $this Fluent Builder */ public function setParameter87Value(string $parameter87Value): self { $this->options['parameter87Value'] = $parameter87Value; return $this; } /** * Parameter name * * @param string $parameter88Name Parameter name * @return $this Fluent Builder */ public function setParameter88Name(string $parameter88Name): self { $this->options['parameter88Name'] = $parameter88Name; return $this; } /** * Parameter value * * @param string $parameter88Value Parameter value * @return $this Fluent Builder */ public function setParameter88Value(string $parameter88Value): self { $this->options['parameter88Value'] = $parameter88Value; return $this; } /** * Parameter name * * @param string $parameter89Name Parameter name * @return $this Fluent Builder */ public function setParameter89Name(string $parameter89Name): self { $this->options['parameter89Name'] = $parameter89Name; return $this; } /** * Parameter value * * @param string $parameter89Value Parameter value * @return $this Fluent Builder */ public function setParameter89Value(string $parameter89Value): self { $this->options['parameter89Value'] = $parameter89Value; return $this; } /** * Parameter name * * @param string $parameter90Name Parameter name * @return $this Fluent Builder */ public function setParameter90Name(string $parameter90Name): self { $this->options['parameter90Name'] = $parameter90Name; return $this; } /** * Parameter value * * @param string $parameter90Value Parameter value * @return $this Fluent Builder */ public function setParameter90Value(string $parameter90Value): self { $this->options['parameter90Value'] = $parameter90Value; return $this; } /** * Parameter name * * @param string $parameter91Name Parameter name * @return $this Fluent Builder */ public function setParameter91Name(string $parameter91Name): self { $this->options['parameter91Name'] = $parameter91Name; return $this; } /** * Parameter value * * @param string $parameter91Value Parameter value * @return $this Fluent Builder */ public function setParameter91Value(string $parameter91Value): self { $this->options['parameter91Value'] = $parameter91Value; return $this; } /** * Parameter name * * @param string $parameter92Name Parameter name * @return $this Fluent Builder */ public function setParameter92Name(string $parameter92Name): self { $this->options['parameter92Name'] = $parameter92Name; return $this; } /** * Parameter value * * @param string $parameter92Value Parameter value * @return $this Fluent Builder */ public function setParameter92Value(string $parameter92Value): self { $this->options['parameter92Value'] = $parameter92Value; return $this; } /** * Parameter name * * @param string $parameter93Name Parameter name * @return $this Fluent Builder */ public function setParameter93Name(string $parameter93Name): self { $this->options['parameter93Name'] = $parameter93Name; return $this; } /** * Parameter value * * @param string $parameter93Value Parameter value * @return $this Fluent Builder */ public function setParameter93Value(string $parameter93Value): self { $this->options['parameter93Value'] = $parameter93Value; return $this; } /** * Parameter name * * @param string $parameter94Name Parameter name * @return $this Fluent Builder */ public function setParameter94Name(string $parameter94Name): self { $this->options['parameter94Name'] = $parameter94Name; return $this; } /** * Parameter value * * @param string $parameter94Value Parameter value * @return $this Fluent Builder */ public function setParameter94Value(string $parameter94Value): self { $this->options['parameter94Value'] = $parameter94Value; return $this; } /** * Parameter name * * @param string $parameter95Name Parameter name * @return $this Fluent Builder */ public function setParameter95Name(string $parameter95Name): self { $this->options['parameter95Name'] = $parameter95Name; return $this; } /** * Parameter value * * @param string $parameter95Value Parameter value * @return $this Fluent Builder */ public function setParameter95Value(string $parameter95Value): self { $this->options['parameter95Value'] = $parameter95Value; return $this; } /** * Parameter name * * @param string $parameter96Name Parameter name * @return $this Fluent Builder */ public function setParameter96Name(string $parameter96Name): self { $this->options['parameter96Name'] = $parameter96Name; return $this; } /** * Parameter value * * @param string $parameter96Value Parameter value * @return $this Fluent Builder */ public function setParameter96Value(string $parameter96Value): self { $this->options['parameter96Value'] = $parameter96Value; return $this; } /** * Parameter name * * @param string $parameter97Name Parameter name * @return $this Fluent Builder */ public function setParameter97Name(string $parameter97Name): self { $this->options['parameter97Name'] = $parameter97Name; return $this; } /** * Parameter value * * @param string $parameter97Value Parameter value * @return $this Fluent Builder */ public function setParameter97Value(string $parameter97Value): self { $this->options['parameter97Value'] = $parameter97Value; return $this; } /** * Parameter name * * @param string $parameter98Name Parameter name * @return $this Fluent Builder */ public function setParameter98Name(string $parameter98Name): self { $this->options['parameter98Name'] = $parameter98Name; return $this; } /** * Parameter value * * @param string $parameter98Value Parameter value * @return $this Fluent Builder */ public function setParameter98Value(string $parameter98Value): self { $this->options['parameter98Value'] = $parameter98Value; return $this; } /** * Parameter name * * @param string $parameter99Name Parameter name * @return $this Fluent Builder */ public function setParameter99Name(string $parameter99Name): self { $this->options['parameter99Name'] = $parameter99Name; return $this; } /** * Parameter value * * @param string $parameter99Value Parameter value * @return $this Fluent Builder */ public function setParameter99Value(string $parameter99Value): self { $this->options['parameter99Value'] = $parameter99Value; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateStreamOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php000064400000005064150364341760024173 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php000064400000044053150364341760020010 0ustar00=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return ReadRecordingOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ): ReadRecordingOptions { return new ReadRecordingOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter ); } /** * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * @return UpdateRecordingOptions Options builder */ public static function update( string $pauseBehavior = Values::NONE ): UpdateRecordingOptions { return new UpdateRecordingOptions( $pauseBehavior ); } } class CreateRecordingOptions extends Options { /** * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. */ public function __construct( array $recordingStatusCallbackEvent = Values::ARRAY_NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $trim = Values::NONE, string $recordingChannels = Values::NONE, string $recordingTrack = Values::NONE ) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['trim'] = $trim; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingTrack'] = $recordingTrack; } /** * The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. * * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). * * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). * @return $this Fluent Builder */ public function setRecordingStatusCallback(string $recordingStatusCallback): self { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. * * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. * @return $this Fluent Builder */ public function setTrim(string $trim): self { $this->options['trim'] = $trim; return $this; } /** * The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. * * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. * @return $this Fluent Builder */ public function setRecordingChannels(string $recordingChannels): self { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * @return $this Fluent Builder */ public function setRecordingTrack(string $recordingTrack): self { $this->options['recordingTrack'] = $recordingTrack; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateRecordingOptions ' . $options . ']'; } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; } } class UpdateRecordingOptions extends Options { /** * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. */ public function __construct( string $pauseBehavior = Values::NONE ) { $this->options['pauseBehavior'] = $pauseBehavior; } /** * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * @return $this Fluent Builder */ public function setPauseBehavior(string $pauseBehavior): self { $this->options['pauseBehavior'] = $pauseBehavior; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryList.php000064400000006476150364341760020425 0ustar00solution = [ '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. Format is `YYYY-MM-DD` and specified in UTC. * @param \DateTime $endDate Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. * @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 34 character string that uniquely identifies this 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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecList.php000064400000045136150364341760016604 0ustar00solution = [ '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` used when creating the resource */ public function getContext( string $sid ): SiprecContext { return new SiprecContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SiprecList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.php000064400000010451150364341760021131 0ustar00options['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 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. * @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 (`GET` or `POST`) we use to make the request 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 . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamList.php000064400000045303150364341760016606 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Streams.json'; } /** * Create the StreamInstance * * @param string $url Relative or absolute url where WebSocket connection will be established. * @param array|Options $options Optional Arguments * @return StreamInstance Created StreamInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $url, array $options = []): StreamInstance { $options = new Values($options); $data = Values::of([ 'Url' => $url, 'Name' => $options['name'], 'Track' => $options['track'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Parameter1.Name' => $options['parameter1Name'], 'Parameter1.Value' => $options['parameter1Value'], 'Parameter2.Name' => $options['parameter2Name'], 'Parameter2.Value' => $options['parameter2Value'], 'Parameter3.Name' => $options['parameter3Name'], 'Parameter3.Value' => $options['parameter3Value'], 'Parameter4.Name' => $options['parameter4Name'], 'Parameter4.Value' => $options['parameter4Value'], 'Parameter5.Name' => $options['parameter5Name'], 'Parameter5.Value' => $options['parameter5Value'], 'Parameter6.Name' => $options['parameter6Name'], 'Parameter6.Value' => $options['parameter6Value'], 'Parameter7.Name' => $options['parameter7Name'], 'Parameter7.Value' => $options['parameter7Value'], 'Parameter8.Name' => $options['parameter8Name'], 'Parameter8.Value' => $options['parameter8Value'], 'Parameter9.Name' => $options['parameter9Name'], 'Parameter9.Value' => $options['parameter9Value'], 'Parameter10.Name' => $options['parameter10Name'], 'Parameter10.Value' => $options['parameter10Value'], 'Parameter11.Name' => $options['parameter11Name'], 'Parameter11.Value' => $options['parameter11Value'], 'Parameter12.Name' => $options['parameter12Name'], 'Parameter12.Value' => $options['parameter12Value'], 'Parameter13.Name' => $options['parameter13Name'], 'Parameter13.Value' => $options['parameter13Value'], 'Parameter14.Name' => $options['parameter14Name'], 'Parameter14.Value' => $options['parameter14Value'], 'Parameter15.Name' => $options['parameter15Name'], 'Parameter15.Value' => $options['parameter15Value'], 'Parameter16.Name' => $options['parameter16Name'], 'Parameter16.Value' => $options['parameter16Value'], 'Parameter17.Name' => $options['parameter17Name'], 'Parameter17.Value' => $options['parameter17Value'], 'Parameter18.Name' => $options['parameter18Name'], 'Parameter18.Value' => $options['parameter18Value'], 'Parameter19.Name' => $options['parameter19Name'], 'Parameter19.Value' => $options['parameter19Value'], 'Parameter20.Name' => $options['parameter20Name'], 'Parameter20.Value' => $options['parameter20Value'], 'Parameter21.Name' => $options['parameter21Name'], 'Parameter21.Value' => $options['parameter21Value'], 'Parameter22.Name' => $options['parameter22Name'], 'Parameter22.Value' => $options['parameter22Value'], 'Parameter23.Name' => $options['parameter23Name'], 'Parameter23.Value' => $options['parameter23Value'], 'Parameter24.Name' => $options['parameter24Name'], 'Parameter24.Value' => $options['parameter24Value'], 'Parameter25.Name' => $options['parameter25Name'], 'Parameter25.Value' => $options['parameter25Value'], 'Parameter26.Name' => $options['parameter26Name'], 'Parameter26.Value' => $options['parameter26Value'], 'Parameter27.Name' => $options['parameter27Name'], 'Parameter27.Value' => $options['parameter27Value'], 'Parameter28.Name' => $options['parameter28Name'], 'Parameter28.Value' => $options['parameter28Value'], 'Parameter29.Name' => $options['parameter29Name'], 'Parameter29.Value' => $options['parameter29Value'], 'Parameter30.Name' => $options['parameter30Name'], 'Parameter30.Value' => $options['parameter30Value'], 'Parameter31.Name' => $options['parameter31Name'], 'Parameter31.Value' => $options['parameter31Value'], 'Parameter32.Name' => $options['parameter32Name'], 'Parameter32.Value' => $options['parameter32Value'], 'Parameter33.Name' => $options['parameter33Name'], 'Parameter33.Value' => $options['parameter33Value'], 'Parameter34.Name' => $options['parameter34Name'], 'Parameter34.Value' => $options['parameter34Value'], 'Parameter35.Name' => $options['parameter35Name'], 'Parameter35.Value' => $options['parameter35Value'], 'Parameter36.Name' => $options['parameter36Name'], 'Parameter36.Value' => $options['parameter36Value'], 'Parameter37.Name' => $options['parameter37Name'], 'Parameter37.Value' => $options['parameter37Value'], 'Parameter38.Name' => $options['parameter38Name'], 'Parameter38.Value' => $options['parameter38Value'], 'Parameter39.Name' => $options['parameter39Name'], 'Parameter39.Value' => $options['parameter39Value'], 'Parameter40.Name' => $options['parameter40Name'], 'Parameter40.Value' => $options['parameter40Value'], 'Parameter41.Name' => $options['parameter41Name'], 'Parameter41.Value' => $options['parameter41Value'], 'Parameter42.Name' => $options['parameter42Name'], 'Parameter42.Value' => $options['parameter42Value'], 'Parameter43.Name' => $options['parameter43Name'], 'Parameter43.Value' => $options['parameter43Value'], 'Parameter44.Name' => $options['parameter44Name'], 'Parameter44.Value' => $options['parameter44Value'], 'Parameter45.Name' => $options['parameter45Name'], 'Parameter45.Value' => $options['parameter45Value'], 'Parameter46.Name' => $options['parameter46Name'], 'Parameter46.Value' => $options['parameter46Value'], 'Parameter47.Name' => $options['parameter47Name'], 'Parameter47.Value' => $options['parameter47Value'], 'Parameter48.Name' => $options['parameter48Name'], 'Parameter48.Value' => $options['parameter48Value'], 'Parameter49.Name' => $options['parameter49Name'], 'Parameter49.Value' => $options['parameter49Value'], 'Parameter50.Name' => $options['parameter50Name'], 'Parameter50.Value' => $options['parameter50Value'], 'Parameter51.Name' => $options['parameter51Name'], 'Parameter51.Value' => $options['parameter51Value'], 'Parameter52.Name' => $options['parameter52Name'], 'Parameter52.Value' => $options['parameter52Value'], 'Parameter53.Name' => $options['parameter53Name'], 'Parameter53.Value' => $options['parameter53Value'], 'Parameter54.Name' => $options['parameter54Name'], 'Parameter54.Value' => $options['parameter54Value'], 'Parameter55.Name' => $options['parameter55Name'], 'Parameter55.Value' => $options['parameter55Value'], 'Parameter56.Name' => $options['parameter56Name'], 'Parameter56.Value' => $options['parameter56Value'], 'Parameter57.Name' => $options['parameter57Name'], 'Parameter57.Value' => $options['parameter57Value'], 'Parameter58.Name' => $options['parameter58Name'], 'Parameter58.Value' => $options['parameter58Value'], 'Parameter59.Name' => $options['parameter59Name'], 'Parameter59.Value' => $options['parameter59Value'], 'Parameter60.Name' => $options['parameter60Name'], 'Parameter60.Value' => $options['parameter60Value'], 'Parameter61.Name' => $options['parameter61Name'], 'Parameter61.Value' => $options['parameter61Value'], 'Parameter62.Name' => $options['parameter62Name'], 'Parameter62.Value' => $options['parameter62Value'], 'Parameter63.Name' => $options['parameter63Name'], 'Parameter63.Value' => $options['parameter63Value'], 'Parameter64.Name' => $options['parameter64Name'], 'Parameter64.Value' => $options['parameter64Value'], 'Parameter65.Name' => $options['parameter65Name'], 'Parameter65.Value' => $options['parameter65Value'], 'Parameter66.Name' => $options['parameter66Name'], 'Parameter66.Value' => $options['parameter66Value'], 'Parameter67.Name' => $options['parameter67Name'], 'Parameter67.Value' => $options['parameter67Value'], 'Parameter68.Name' => $options['parameter68Name'], 'Parameter68.Value' => $options['parameter68Value'], 'Parameter69.Name' => $options['parameter69Name'], 'Parameter69.Value' => $options['parameter69Value'], 'Parameter70.Name' => $options['parameter70Name'], 'Parameter70.Value' => $options['parameter70Value'], 'Parameter71.Name' => $options['parameter71Name'], 'Parameter71.Value' => $options['parameter71Value'], 'Parameter72.Name' => $options['parameter72Name'], 'Parameter72.Value' => $options['parameter72Value'], 'Parameter73.Name' => $options['parameter73Name'], 'Parameter73.Value' => $options['parameter73Value'], 'Parameter74.Name' => $options['parameter74Name'], 'Parameter74.Value' => $options['parameter74Value'], 'Parameter75.Name' => $options['parameter75Name'], 'Parameter75.Value' => $options['parameter75Value'], 'Parameter76.Name' => $options['parameter76Name'], 'Parameter76.Value' => $options['parameter76Value'], 'Parameter77.Name' => $options['parameter77Name'], 'Parameter77.Value' => $options['parameter77Value'], 'Parameter78.Name' => $options['parameter78Name'], 'Parameter78.Value' => $options['parameter78Value'], 'Parameter79.Name' => $options['parameter79Name'], 'Parameter79.Value' => $options['parameter79Value'], 'Parameter80.Name' => $options['parameter80Name'], 'Parameter80.Value' => $options['parameter80Value'], 'Parameter81.Name' => $options['parameter81Name'], 'Parameter81.Value' => $options['parameter81Value'], 'Parameter82.Name' => $options['parameter82Name'], 'Parameter82.Value' => $options['parameter82Value'], 'Parameter83.Name' => $options['parameter83Name'], 'Parameter83.Value' => $options['parameter83Value'], 'Parameter84.Name' => $options['parameter84Name'], 'Parameter84.Value' => $options['parameter84Value'], 'Parameter85.Name' => $options['parameter85Name'], 'Parameter85.Value' => $options['parameter85Value'], 'Parameter86.Name' => $options['parameter86Name'], 'Parameter86.Value' => $options['parameter86Value'], 'Parameter87.Name' => $options['parameter87Name'], 'Parameter87.Value' => $options['parameter87Value'], 'Parameter88.Name' => $options['parameter88Name'], 'Parameter88.Value' => $options['parameter88Value'], 'Parameter89.Name' => $options['parameter89Name'], 'Parameter89.Value' => $options['parameter89Value'], 'Parameter90.Name' => $options['parameter90Name'], 'Parameter90.Value' => $options['parameter90Value'], 'Parameter91.Name' => $options['parameter91Name'], 'Parameter91.Value' => $options['parameter91Value'], 'Parameter92.Name' => $options['parameter92Name'], 'Parameter92.Value' => $options['parameter92Value'], 'Parameter93.Name' => $options['parameter93Name'], 'Parameter93.Value' => $options['parameter93Value'], 'Parameter94.Name' => $options['parameter94Name'], 'Parameter94.Value' => $options['parameter94Value'], 'Parameter95.Name' => $options['parameter95Name'], 'Parameter95.Value' => $options['parameter95Value'], 'Parameter96.Name' => $options['parameter96Name'], 'Parameter96.Value' => $options['parameter96Value'], 'Parameter97.Name' => $options['parameter97Name'], 'Parameter97.Value' => $options['parameter97Value'], 'Parameter98.Name' => $options['parameter98Name'], 'Parameter98.Value' => $options['parameter98Value'], 'Parameter99.Name' => $options['parameter99Name'], 'Parameter99.Value' => $options['parameter99Value'], ]); $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` used when creating the resource */ 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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventPage.php000064400000003120150364341760016364 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php000064400000003346150364341760023424 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageList.php000064400000005366150364341760021062 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php000064400000012622150364341760020630 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php000064400000003150150364341760017222 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php000064400000003134150364341760016725 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackPage.php000064400000003142150364341760016773 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php000064400000003172150364341760017740 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php000064400000006344150364341760024204 0ustar00options['idempotencyKey'] = $idempotencyKey; $this->options['method'] = $method; } /** * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * @return $this Fluent Builder */ public function setIdempotencyKey(string $idempotencyKey): self { $this->options['idempotencyKey'] = $idempotencyKey; return $this; } /** * The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. * * @param string $method The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateUserDefinedMessageSubscriptionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecPage.php000064400000003126150364341760016536 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php000064400000007122150364341760023457 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/UserDefinedMessageSubscriptions.json'; } /** * Create the UserDefinedMessageSubscriptionInstance * * @param string $callback The URL we should call using the `method` to send user defined events to your application. URLs must contain a valid hostname (underscores are not permitted). * @param array|Options $options Optional Arguments * @return UserDefinedMessageSubscriptionInstance Created UserDefinedMessageSubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $callback, array $options = []): UserDefinedMessageSubscriptionInstance { $options = new Values($options); $data = Values::of([ 'Callback' => $callback, 'IdempotencyKey' => $options['idempotencyKey'], 'Method' => $options['method'], ]); $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 The SID that uniquely identifies this User Defined Message Subscription. */ public function getContext( string $sid ): UserDefinedMessageSubscriptionContext { return new UserDefinedMessageSubscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php000064400000015560150364341760020523 0ustar00=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return ReadNotificationOptions Options builder */ public static function read( int $log = Values::INT_NONE, string $messageDateBefore = null, string $messageDate = null, string $messageDateAfter = null ): ReadNotificationOptions { return new ReadNotificationOptions( $log, $messageDateBefore, $messageDate, $messageDateAfter ); } } class ReadNotificationOptions extends Options { /** * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ public function __construct( int $log = Values::INT_NONE, string $messageDateBefore = null, string $messageDate = null, string $messageDateAfter = null ) { $this->options['log'] = $log; $this->options['messageDateBefore'] = $messageDateBefore; $this->options['messageDate'] = $messageDate; $this->options['messageDateAfter'] = $messageDateAfter; } /** * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @return $this Fluent Builder */ public function setLog(int $log): self { $this->options['log'] = $log; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDateBefore(string $messageDateBefore): self { $this->options['messageDateBefore'] = $messageDateBefore; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDate(string $messageDate): self { $this->options['messageDate'] = $messageDate; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDateAfter(string $messageDateAfter): self { $this->options['messageDateAfter'] = $messageDateAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php000064400000017051150364341760017266 0ustar00solution = [ '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'] ); } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordingPage Page of RecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordingPage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordingPage Page of RecordingInstance */ public function getPage(string $targetUrl): RecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. */ public function getContext( string $sid ): RecordingContext { return new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageInstance.php000064400000005356150364341760021712 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php000064400000005206150364341760020510 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryInstance.php000064400000012367150364341760021252 0ustar00properties = [ '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; } /** * 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(); } /** * Fetch the FeedbackSummaryInstance * * @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FeedbackSummaryInstance { 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.FeedbackSummaryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php000064400000011566150364341760017625 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PaymentContext Context for this PaymentInstance */ protected function proxy(): PaymentContext { if (!$this->context) { $this->context = new PaymentContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the PaymentInstance * * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. * @param array|Options $options Optional Arguments * @return PaymentInstance Updated PaymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance { return $this->proxy()->update($idempotencyKey, $statusCallback, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PaymentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageOptions.php000064400000004477150364341760021604 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php000064400000007231150364341760017477 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Payments/' . \rawurlencode($sid) .'.json'; } /** * Update the PaymentInstance * * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. * @param array|Options $options Optional Arguments * @return PaymentInstance Updated PaymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance { $options = new Values($options); $data = Values::of([ 'IdempotencyKey' => $idempotencyKey, 'StatusCallback' => $statusCallback, 'Capture' => $options['capture'], 'Status' => $options['status'], ]); $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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecOptions.php000064400000362215150364341760017324 0ustar00options['name'] = $name; $this->options['connectorName'] = $connectorName; $this->options['track'] = $track; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['parameter1Name'] = $parameter1Name; $this->options['parameter1Value'] = $parameter1Value; $this->options['parameter2Name'] = $parameter2Name; $this->options['parameter2Value'] = $parameter2Value; $this->options['parameter3Name'] = $parameter3Name; $this->options['parameter3Value'] = $parameter3Value; $this->options['parameter4Name'] = $parameter4Name; $this->options['parameter4Value'] = $parameter4Value; $this->options['parameter5Name'] = $parameter5Name; $this->options['parameter5Value'] = $parameter5Value; $this->options['parameter6Name'] = $parameter6Name; $this->options['parameter6Value'] = $parameter6Value; $this->options['parameter7Name'] = $parameter7Name; $this->options['parameter7Value'] = $parameter7Value; $this->options['parameter8Name'] = $parameter8Name; $this->options['parameter8Value'] = $parameter8Value; $this->options['parameter9Name'] = $parameter9Name; $this->options['parameter9Value'] = $parameter9Value; $this->options['parameter10Name'] = $parameter10Name; $this->options['parameter10Value'] = $parameter10Value; $this->options['parameter11Name'] = $parameter11Name; $this->options['parameter11Value'] = $parameter11Value; $this->options['parameter12Name'] = $parameter12Name; $this->options['parameter12Value'] = $parameter12Value; $this->options['parameter13Name'] = $parameter13Name; $this->options['parameter13Value'] = $parameter13Value; $this->options['parameter14Name'] = $parameter14Name; $this->options['parameter14Value'] = $parameter14Value; $this->options['parameter15Name'] = $parameter15Name; $this->options['parameter15Value'] = $parameter15Value; $this->options['parameter16Name'] = $parameter16Name; $this->options['parameter16Value'] = $parameter16Value; $this->options['parameter17Name'] = $parameter17Name; $this->options['parameter17Value'] = $parameter17Value; $this->options['parameter18Name'] = $parameter18Name; $this->options['parameter18Value'] = $parameter18Value; $this->options['parameter19Name'] = $parameter19Name; $this->options['parameter19Value'] = $parameter19Value; $this->options['parameter20Name'] = $parameter20Name; $this->options['parameter20Value'] = $parameter20Value; $this->options['parameter21Name'] = $parameter21Name; $this->options['parameter21Value'] = $parameter21Value; $this->options['parameter22Name'] = $parameter22Name; $this->options['parameter22Value'] = $parameter22Value; $this->options['parameter23Name'] = $parameter23Name; $this->options['parameter23Value'] = $parameter23Value; $this->options['parameter24Name'] = $parameter24Name; $this->options['parameter24Value'] = $parameter24Value; $this->options['parameter25Name'] = $parameter25Name; $this->options['parameter25Value'] = $parameter25Value; $this->options['parameter26Name'] = $parameter26Name; $this->options['parameter26Value'] = $parameter26Value; $this->options['parameter27Name'] = $parameter27Name; $this->options['parameter27Value'] = $parameter27Value; $this->options['parameter28Name'] = $parameter28Name; $this->options['parameter28Value'] = $parameter28Value; $this->options['parameter29Name'] = $parameter29Name; $this->options['parameter29Value'] = $parameter29Value; $this->options['parameter30Name'] = $parameter30Name; $this->options['parameter30Value'] = $parameter30Value; $this->options['parameter31Name'] = $parameter31Name; $this->options['parameter31Value'] = $parameter31Value; $this->options['parameter32Name'] = $parameter32Name; $this->options['parameter32Value'] = $parameter32Value; $this->options['parameter33Name'] = $parameter33Name; $this->options['parameter33Value'] = $parameter33Value; $this->options['parameter34Name'] = $parameter34Name; $this->options['parameter34Value'] = $parameter34Value; $this->options['parameter35Name'] = $parameter35Name; $this->options['parameter35Value'] = $parameter35Value; $this->options['parameter36Name'] = $parameter36Name; $this->options['parameter36Value'] = $parameter36Value; $this->options['parameter37Name'] = $parameter37Name; $this->options['parameter37Value'] = $parameter37Value; $this->options['parameter38Name'] = $parameter38Name; $this->options['parameter38Value'] = $parameter38Value; $this->options['parameter39Name'] = $parameter39Name; $this->options['parameter39Value'] = $parameter39Value; $this->options['parameter40Name'] = $parameter40Name; $this->options['parameter40Value'] = $parameter40Value; $this->options['parameter41Name'] = $parameter41Name; $this->options['parameter41Value'] = $parameter41Value; $this->options['parameter42Name'] = $parameter42Name; $this->options['parameter42Value'] = $parameter42Value; $this->options['parameter43Name'] = $parameter43Name; $this->options['parameter43Value'] = $parameter43Value; $this->options['parameter44Name'] = $parameter44Name; $this->options['parameter44Value'] = $parameter44Value; $this->options['parameter45Name'] = $parameter45Name; $this->options['parameter45Value'] = $parameter45Value; $this->options['parameter46Name'] = $parameter46Name; $this->options['parameter46Value'] = $parameter46Value; $this->options['parameter47Name'] = $parameter47Name; $this->options['parameter47Value'] = $parameter47Value; $this->options['parameter48Name'] = $parameter48Name; $this->options['parameter48Value'] = $parameter48Value; $this->options['parameter49Name'] = $parameter49Name; $this->options['parameter49Value'] = $parameter49Value; $this->options['parameter50Name'] = $parameter50Name; $this->options['parameter50Value'] = $parameter50Value; $this->options['parameter51Name'] = $parameter51Name; $this->options['parameter51Value'] = $parameter51Value; $this->options['parameter52Name'] = $parameter52Name; $this->options['parameter52Value'] = $parameter52Value; $this->options['parameter53Name'] = $parameter53Name; $this->options['parameter53Value'] = $parameter53Value; $this->options['parameter54Name'] = $parameter54Name; $this->options['parameter54Value'] = $parameter54Value; $this->options['parameter55Name'] = $parameter55Name; $this->options['parameter55Value'] = $parameter55Value; $this->options['parameter56Name'] = $parameter56Name; $this->options['parameter56Value'] = $parameter56Value; $this->options['parameter57Name'] = $parameter57Name; $this->options['parameter57Value'] = $parameter57Value; $this->options['parameter58Name'] = $parameter58Name; $this->options['parameter58Value'] = $parameter58Value; $this->options['parameter59Name'] = $parameter59Name; $this->options['parameter59Value'] = $parameter59Value; $this->options['parameter60Name'] = $parameter60Name; $this->options['parameter60Value'] = $parameter60Value; $this->options['parameter61Name'] = $parameter61Name; $this->options['parameter61Value'] = $parameter61Value; $this->options['parameter62Name'] = $parameter62Name; $this->options['parameter62Value'] = $parameter62Value; $this->options['parameter63Name'] = $parameter63Name; $this->options['parameter63Value'] = $parameter63Value; $this->options['parameter64Name'] = $parameter64Name; $this->options['parameter64Value'] = $parameter64Value; $this->options['parameter65Name'] = $parameter65Name; $this->options['parameter65Value'] = $parameter65Value; $this->options['parameter66Name'] = $parameter66Name; $this->options['parameter66Value'] = $parameter66Value; $this->options['parameter67Name'] = $parameter67Name; $this->options['parameter67Value'] = $parameter67Value; $this->options['parameter68Name'] = $parameter68Name; $this->options['parameter68Value'] = $parameter68Value; $this->options['parameter69Name'] = $parameter69Name; $this->options['parameter69Value'] = $parameter69Value; $this->options['parameter70Name'] = $parameter70Name; $this->options['parameter70Value'] = $parameter70Value; $this->options['parameter71Name'] = $parameter71Name; $this->options['parameter71Value'] = $parameter71Value; $this->options['parameter72Name'] = $parameter72Name; $this->options['parameter72Value'] = $parameter72Value; $this->options['parameter73Name'] = $parameter73Name; $this->options['parameter73Value'] = $parameter73Value; $this->options['parameter74Name'] = $parameter74Name; $this->options['parameter74Value'] = $parameter74Value; $this->options['parameter75Name'] = $parameter75Name; $this->options['parameter75Value'] = $parameter75Value; $this->options['parameter76Name'] = $parameter76Name; $this->options['parameter76Value'] = $parameter76Value; $this->options['parameter77Name'] = $parameter77Name; $this->options['parameter77Value'] = $parameter77Value; $this->options['parameter78Name'] = $parameter78Name; $this->options['parameter78Value'] = $parameter78Value; $this->options['parameter79Name'] = $parameter79Name; $this->options['parameter79Value'] = $parameter79Value; $this->options['parameter80Name'] = $parameter80Name; $this->options['parameter80Value'] = $parameter80Value; $this->options['parameter81Name'] = $parameter81Name; $this->options['parameter81Value'] = $parameter81Value; $this->options['parameter82Name'] = $parameter82Name; $this->options['parameter82Value'] = $parameter82Value; $this->options['parameter83Name'] = $parameter83Name; $this->options['parameter83Value'] = $parameter83Value; $this->options['parameter84Name'] = $parameter84Name; $this->options['parameter84Value'] = $parameter84Value; $this->options['parameter85Name'] = $parameter85Name; $this->options['parameter85Value'] = $parameter85Value; $this->options['parameter86Name'] = $parameter86Name; $this->options['parameter86Value'] = $parameter86Value; $this->options['parameter87Name'] = $parameter87Name; $this->options['parameter87Value'] = $parameter87Value; $this->options['parameter88Name'] = $parameter88Name; $this->options['parameter88Value'] = $parameter88Value; $this->options['parameter89Name'] = $parameter89Name; $this->options['parameter89Value'] = $parameter89Value; $this->options['parameter90Name'] = $parameter90Name; $this->options['parameter90Value'] = $parameter90Value; $this->options['parameter91Name'] = $parameter91Name; $this->options['parameter91Value'] = $parameter91Value; $this->options['parameter92Name'] = $parameter92Name; $this->options['parameter92Value'] = $parameter92Value; $this->options['parameter93Name'] = $parameter93Name; $this->options['parameter93Value'] = $parameter93Value; $this->options['parameter94Name'] = $parameter94Name; $this->options['parameter94Value'] = $parameter94Value; $this->options['parameter95Name'] = $parameter95Name; $this->options['parameter95Value'] = $parameter95Value; $this->options['parameter96Name'] = $parameter96Name; $this->options['parameter96Value'] = $parameter96Value; $this->options['parameter97Name'] = $parameter97Name; $this->options['parameter97Value'] = $parameter97Value; $this->options['parameter98Name'] = $parameter98Name; $this->options['parameter98Value'] = $parameter98Value; $this->options['parameter99Name'] = $parameter99Name; $this->options['parameter99Value'] = $parameter99Value; } /** * The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. * * @param string $name The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. * @return $this Fluent Builder */ public function setName(string $name): self { $this->options['name'] = $name; return $this; } /** * Unique name used when configuring the connector via Marketplace Add-on. * * @param string $connectorName Unique name used when configuring the connector via Marketplace Add-on. * @return $this Fluent Builder */ public function setConnectorName(string $connectorName): self { $this->options['connectorName'] = $connectorName; return $this; } /** * @param string $track * @return $this Fluent Builder */ public function setTrack(string $track): self { $this->options['track'] = $track; return $this; } /** * Absolute URL of the status callback. * * @param string $statusCallback Absolute URL of the status callback. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The http method for the status_callback (one of GET, POST). * * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Parameter name * * @param string $parameter1Name Parameter name * @return $this Fluent Builder */ public function setParameter1Name(string $parameter1Name): self { $this->options['parameter1Name'] = $parameter1Name; return $this; } /** * Parameter value * * @param string $parameter1Value Parameter value * @return $this Fluent Builder */ public function setParameter1Value(string $parameter1Value): self { $this->options['parameter1Value'] = $parameter1Value; return $this; } /** * Parameter name * * @param string $parameter2Name Parameter name * @return $this Fluent Builder */ public function setParameter2Name(string $parameter2Name): self { $this->options['parameter2Name'] = $parameter2Name; return $this; } /** * Parameter value * * @param string $parameter2Value Parameter value * @return $this Fluent Builder */ public function setParameter2Value(string $parameter2Value): self { $this->options['parameter2Value'] = $parameter2Value; return $this; } /** * Parameter name * * @param string $parameter3Name Parameter name * @return $this Fluent Builder */ public function setParameter3Name(string $parameter3Name): self { $this->options['parameter3Name'] = $parameter3Name; return $this; } /** * Parameter value * * @param string $parameter3Value Parameter value * @return $this Fluent Builder */ public function setParameter3Value(string $parameter3Value): self { $this->options['parameter3Value'] = $parameter3Value; return $this; } /** * Parameter name * * @param string $parameter4Name Parameter name * @return $this Fluent Builder */ public function setParameter4Name(string $parameter4Name): self { $this->options['parameter4Name'] = $parameter4Name; return $this; } /** * Parameter value * * @param string $parameter4Value Parameter value * @return $this Fluent Builder */ public function setParameter4Value(string $parameter4Value): self { $this->options['parameter4Value'] = $parameter4Value; return $this; } /** * Parameter name * * @param string $parameter5Name Parameter name * @return $this Fluent Builder */ public function setParameter5Name(string $parameter5Name): self { $this->options['parameter5Name'] = $parameter5Name; return $this; } /** * Parameter value * * @param string $parameter5Value Parameter value * @return $this Fluent Builder */ public function setParameter5Value(string $parameter5Value): self { $this->options['parameter5Value'] = $parameter5Value; return $this; } /** * Parameter name * * @param string $parameter6Name Parameter name * @return $this Fluent Builder */ public function setParameter6Name(string $parameter6Name): self { $this->options['parameter6Name'] = $parameter6Name; return $this; } /** * Parameter value * * @param string $parameter6Value Parameter value * @return $this Fluent Builder */ public function setParameter6Value(string $parameter6Value): self { $this->options['parameter6Value'] = $parameter6Value; return $this; } /** * Parameter name * * @param string $parameter7Name Parameter name * @return $this Fluent Builder */ public function setParameter7Name(string $parameter7Name): self { $this->options['parameter7Name'] = $parameter7Name; return $this; } /** * Parameter value * * @param string $parameter7Value Parameter value * @return $this Fluent Builder */ public function setParameter7Value(string $parameter7Value): self { $this->options['parameter7Value'] = $parameter7Value; return $this; } /** * Parameter name * * @param string $parameter8Name Parameter name * @return $this Fluent Builder */ public function setParameter8Name(string $parameter8Name): self { $this->options['parameter8Name'] = $parameter8Name; return $this; } /** * Parameter value * * @param string $parameter8Value Parameter value * @return $this Fluent Builder */ public function setParameter8Value(string $parameter8Value): self { $this->options['parameter8Value'] = $parameter8Value; return $this; } /** * Parameter name * * @param string $parameter9Name Parameter name * @return $this Fluent Builder */ public function setParameter9Name(string $parameter9Name): self { $this->options['parameter9Name'] = $parameter9Name; return $this; } /** * Parameter value * * @param string $parameter9Value Parameter value * @return $this Fluent Builder */ public function setParameter9Value(string $parameter9Value): self { $this->options['parameter9Value'] = $parameter9Value; return $this; } /** * Parameter name * * @param string $parameter10Name Parameter name * @return $this Fluent Builder */ public function setParameter10Name(string $parameter10Name): self { $this->options['parameter10Name'] = $parameter10Name; return $this; } /** * Parameter value * * @param string $parameter10Value Parameter value * @return $this Fluent Builder */ public function setParameter10Value(string $parameter10Value): self { $this->options['parameter10Value'] = $parameter10Value; return $this; } /** * Parameter name * * @param string $parameter11Name Parameter name * @return $this Fluent Builder */ public function setParameter11Name(string $parameter11Name): self { $this->options['parameter11Name'] = $parameter11Name; return $this; } /** * Parameter value * * @param string $parameter11Value Parameter value * @return $this Fluent Builder */ public function setParameter11Value(string $parameter11Value): self { $this->options['parameter11Value'] = $parameter11Value; return $this; } /** * Parameter name * * @param string $parameter12Name Parameter name * @return $this Fluent Builder */ public function setParameter12Name(string $parameter12Name): self { $this->options['parameter12Name'] = $parameter12Name; return $this; } /** * Parameter value * * @param string $parameter12Value Parameter value * @return $this Fluent Builder */ public function setParameter12Value(string $parameter12Value): self { $this->options['parameter12Value'] = $parameter12Value; return $this; } /** * Parameter name * * @param string $parameter13Name Parameter name * @return $this Fluent Builder */ public function setParameter13Name(string $parameter13Name): self { $this->options['parameter13Name'] = $parameter13Name; return $this; } /** * Parameter value * * @param string $parameter13Value Parameter value * @return $this Fluent Builder */ public function setParameter13Value(string $parameter13Value): self { $this->options['parameter13Value'] = $parameter13Value; return $this; } /** * Parameter name * * @param string $parameter14Name Parameter name * @return $this Fluent Builder */ public function setParameter14Name(string $parameter14Name): self { $this->options['parameter14Name'] = $parameter14Name; return $this; } /** * Parameter value * * @param string $parameter14Value Parameter value * @return $this Fluent Builder */ public function setParameter14Value(string $parameter14Value): self { $this->options['parameter14Value'] = $parameter14Value; return $this; } /** * Parameter name * * @param string $parameter15Name Parameter name * @return $this Fluent Builder */ public function setParameter15Name(string $parameter15Name): self { $this->options['parameter15Name'] = $parameter15Name; return $this; } /** * Parameter value * * @param string $parameter15Value Parameter value * @return $this Fluent Builder */ public function setParameter15Value(string $parameter15Value): self { $this->options['parameter15Value'] = $parameter15Value; return $this; } /** * Parameter name * * @param string $parameter16Name Parameter name * @return $this Fluent Builder */ public function setParameter16Name(string $parameter16Name): self { $this->options['parameter16Name'] = $parameter16Name; return $this; } /** * Parameter value * * @param string $parameter16Value Parameter value * @return $this Fluent Builder */ public function setParameter16Value(string $parameter16Value): self { $this->options['parameter16Value'] = $parameter16Value; return $this; } /** * Parameter name * * @param string $parameter17Name Parameter name * @return $this Fluent Builder */ public function setParameter17Name(string $parameter17Name): self { $this->options['parameter17Name'] = $parameter17Name; return $this; } /** * Parameter value * * @param string $parameter17Value Parameter value * @return $this Fluent Builder */ public function setParameter17Value(string $parameter17Value): self { $this->options['parameter17Value'] = $parameter17Value; return $this; } /** * Parameter name * * @param string $parameter18Name Parameter name * @return $this Fluent Builder */ public function setParameter18Name(string $parameter18Name): self { $this->options['parameter18Name'] = $parameter18Name; return $this; } /** * Parameter value * * @param string $parameter18Value Parameter value * @return $this Fluent Builder */ public function setParameter18Value(string $parameter18Value): self { $this->options['parameter18Value'] = $parameter18Value; return $this; } /** * Parameter name * * @param string $parameter19Name Parameter name * @return $this Fluent Builder */ public function setParameter19Name(string $parameter19Name): self { $this->options['parameter19Name'] = $parameter19Name; return $this; } /** * Parameter value * * @param string $parameter19Value Parameter value * @return $this Fluent Builder */ public function setParameter19Value(string $parameter19Value): self { $this->options['parameter19Value'] = $parameter19Value; return $this; } /** * Parameter name * * @param string $parameter20Name Parameter name * @return $this Fluent Builder */ public function setParameter20Name(string $parameter20Name): self { $this->options['parameter20Name'] = $parameter20Name; return $this; } /** * Parameter value * * @param string $parameter20Value Parameter value * @return $this Fluent Builder */ public function setParameter20Value(string $parameter20Value): self { $this->options['parameter20Value'] = $parameter20Value; return $this; } /** * Parameter name * * @param string $parameter21Name Parameter name * @return $this Fluent Builder */ public function setParameter21Name(string $parameter21Name): self { $this->options['parameter21Name'] = $parameter21Name; return $this; } /** * Parameter value * * @param string $parameter21Value Parameter value * @return $this Fluent Builder */ public function setParameter21Value(string $parameter21Value): self { $this->options['parameter21Value'] = $parameter21Value; return $this; } /** * Parameter name * * @param string $parameter22Name Parameter name * @return $this Fluent Builder */ public function setParameter22Name(string $parameter22Name): self { $this->options['parameter22Name'] = $parameter22Name; return $this; } /** * Parameter value * * @param string $parameter22Value Parameter value * @return $this Fluent Builder */ public function setParameter22Value(string $parameter22Value): self { $this->options['parameter22Value'] = $parameter22Value; return $this; } /** * Parameter name * * @param string $parameter23Name Parameter name * @return $this Fluent Builder */ public function setParameter23Name(string $parameter23Name): self { $this->options['parameter23Name'] = $parameter23Name; return $this; } /** * Parameter value * * @param string $parameter23Value Parameter value * @return $this Fluent Builder */ public function setParameter23Value(string $parameter23Value): self { $this->options['parameter23Value'] = $parameter23Value; return $this; } /** * Parameter name * * @param string $parameter24Name Parameter name * @return $this Fluent Builder */ public function setParameter24Name(string $parameter24Name): self { $this->options['parameter24Name'] = $parameter24Name; return $this; } /** * Parameter value * * @param string $parameter24Value Parameter value * @return $this Fluent Builder */ public function setParameter24Value(string $parameter24Value): self { $this->options['parameter24Value'] = $parameter24Value; return $this; } /** * Parameter name * * @param string $parameter25Name Parameter name * @return $this Fluent Builder */ public function setParameter25Name(string $parameter25Name): self { $this->options['parameter25Name'] = $parameter25Name; return $this; } /** * Parameter value * * @param string $parameter25Value Parameter value * @return $this Fluent Builder */ public function setParameter25Value(string $parameter25Value): self { $this->options['parameter25Value'] = $parameter25Value; return $this; } /** * Parameter name * * @param string $parameter26Name Parameter name * @return $this Fluent Builder */ public function setParameter26Name(string $parameter26Name): self { $this->options['parameter26Name'] = $parameter26Name; return $this; } /** * Parameter value * * @param string $parameter26Value Parameter value * @return $this Fluent Builder */ public function setParameter26Value(string $parameter26Value): self { $this->options['parameter26Value'] = $parameter26Value; return $this; } /** * Parameter name * * @param string $parameter27Name Parameter name * @return $this Fluent Builder */ public function setParameter27Name(string $parameter27Name): self { $this->options['parameter27Name'] = $parameter27Name; return $this; } /** * Parameter value * * @param string $parameter27Value Parameter value * @return $this Fluent Builder */ public function setParameter27Value(string $parameter27Value): self { $this->options['parameter27Value'] = $parameter27Value; return $this; } /** * Parameter name * * @param string $parameter28Name Parameter name * @return $this Fluent Builder */ public function setParameter28Name(string $parameter28Name): self { $this->options['parameter28Name'] = $parameter28Name; return $this; } /** * Parameter value * * @param string $parameter28Value Parameter value * @return $this Fluent Builder */ public function setParameter28Value(string $parameter28Value): self { $this->options['parameter28Value'] = $parameter28Value; return $this; } /** * Parameter name * * @param string $parameter29Name Parameter name * @return $this Fluent Builder */ public function setParameter29Name(string $parameter29Name): self { $this->options['parameter29Name'] = $parameter29Name; return $this; } /** * Parameter value * * @param string $parameter29Value Parameter value * @return $this Fluent Builder */ public function setParameter29Value(string $parameter29Value): self { $this->options['parameter29Value'] = $parameter29Value; return $this; } /** * Parameter name * * @param string $parameter30Name Parameter name * @return $this Fluent Builder */ public function setParameter30Name(string $parameter30Name): self { $this->options['parameter30Name'] = $parameter30Name; return $this; } /** * Parameter value * * @param string $parameter30Value Parameter value * @return $this Fluent Builder */ public function setParameter30Value(string $parameter30Value): self { $this->options['parameter30Value'] = $parameter30Value; return $this; } /** * Parameter name * * @param string $parameter31Name Parameter name * @return $this Fluent Builder */ public function setParameter31Name(string $parameter31Name): self { $this->options['parameter31Name'] = $parameter31Name; return $this; } /** * Parameter value * * @param string $parameter31Value Parameter value * @return $this Fluent Builder */ public function setParameter31Value(string $parameter31Value): self { $this->options['parameter31Value'] = $parameter31Value; return $this; } /** * Parameter name * * @param string $parameter32Name Parameter name * @return $this Fluent Builder */ public function setParameter32Name(string $parameter32Name): self { $this->options['parameter32Name'] = $parameter32Name; return $this; } /** * Parameter value * * @param string $parameter32Value Parameter value * @return $this Fluent Builder */ public function setParameter32Value(string $parameter32Value): self { $this->options['parameter32Value'] = $parameter32Value; return $this; } /** * Parameter name * * @param string $parameter33Name Parameter name * @return $this Fluent Builder */ public function setParameter33Name(string $parameter33Name): self { $this->options['parameter33Name'] = $parameter33Name; return $this; } /** * Parameter value * * @param string $parameter33Value Parameter value * @return $this Fluent Builder */ public function setParameter33Value(string $parameter33Value): self { $this->options['parameter33Value'] = $parameter33Value; return $this; } /** * Parameter name * * @param string $parameter34Name Parameter name * @return $this Fluent Builder */ public function setParameter34Name(string $parameter34Name): self { $this->options['parameter34Name'] = $parameter34Name; return $this; } /** * Parameter value * * @param string $parameter34Value Parameter value * @return $this Fluent Builder */ public function setParameter34Value(string $parameter34Value): self { $this->options['parameter34Value'] = $parameter34Value; return $this; } /** * Parameter name * * @param string $parameter35Name Parameter name * @return $this Fluent Builder */ public function setParameter35Name(string $parameter35Name): self { $this->options['parameter35Name'] = $parameter35Name; return $this; } /** * Parameter value * * @param string $parameter35Value Parameter value * @return $this Fluent Builder */ public function setParameter35Value(string $parameter35Value): self { $this->options['parameter35Value'] = $parameter35Value; return $this; } /** * Parameter name * * @param string $parameter36Name Parameter name * @return $this Fluent Builder */ public function setParameter36Name(string $parameter36Name): self { $this->options['parameter36Name'] = $parameter36Name; return $this; } /** * Parameter value * * @param string $parameter36Value Parameter value * @return $this Fluent Builder */ public function setParameter36Value(string $parameter36Value): self { $this->options['parameter36Value'] = $parameter36Value; return $this; } /** * Parameter name * * @param string $parameter37Name Parameter name * @return $this Fluent Builder */ public function setParameter37Name(string $parameter37Name): self { $this->options['parameter37Name'] = $parameter37Name; return $this; } /** * Parameter value * * @param string $parameter37Value Parameter value * @return $this Fluent Builder */ public function setParameter37Value(string $parameter37Value): self { $this->options['parameter37Value'] = $parameter37Value; return $this; } /** * Parameter name * * @param string $parameter38Name Parameter name * @return $this Fluent Builder */ public function setParameter38Name(string $parameter38Name): self { $this->options['parameter38Name'] = $parameter38Name; return $this; } /** * Parameter value * * @param string $parameter38Value Parameter value * @return $this Fluent Builder */ public function setParameter38Value(string $parameter38Value): self { $this->options['parameter38Value'] = $parameter38Value; return $this; } /** * Parameter name * * @param string $parameter39Name Parameter name * @return $this Fluent Builder */ public function setParameter39Name(string $parameter39Name): self { $this->options['parameter39Name'] = $parameter39Name; return $this; } /** * Parameter value * * @param string $parameter39Value Parameter value * @return $this Fluent Builder */ public function setParameter39Value(string $parameter39Value): self { $this->options['parameter39Value'] = $parameter39Value; return $this; } /** * Parameter name * * @param string $parameter40Name Parameter name * @return $this Fluent Builder */ public function setParameter40Name(string $parameter40Name): self { $this->options['parameter40Name'] = $parameter40Name; return $this; } /** * Parameter value * * @param string $parameter40Value Parameter value * @return $this Fluent Builder */ public function setParameter40Value(string $parameter40Value): self { $this->options['parameter40Value'] = $parameter40Value; return $this; } /** * Parameter name * * @param string $parameter41Name Parameter name * @return $this Fluent Builder */ public function setParameter41Name(string $parameter41Name): self { $this->options['parameter41Name'] = $parameter41Name; return $this; } /** * Parameter value * * @param string $parameter41Value Parameter value * @return $this Fluent Builder */ public function setParameter41Value(string $parameter41Value): self { $this->options['parameter41Value'] = $parameter41Value; return $this; } /** * Parameter name * * @param string $parameter42Name Parameter name * @return $this Fluent Builder */ public function setParameter42Name(string $parameter42Name): self { $this->options['parameter42Name'] = $parameter42Name; return $this; } /** * Parameter value * * @param string $parameter42Value Parameter value * @return $this Fluent Builder */ public function setParameter42Value(string $parameter42Value): self { $this->options['parameter42Value'] = $parameter42Value; return $this; } /** * Parameter name * * @param string $parameter43Name Parameter name * @return $this Fluent Builder */ public function setParameter43Name(string $parameter43Name): self { $this->options['parameter43Name'] = $parameter43Name; return $this; } /** * Parameter value * * @param string $parameter43Value Parameter value * @return $this Fluent Builder */ public function setParameter43Value(string $parameter43Value): self { $this->options['parameter43Value'] = $parameter43Value; return $this; } /** * Parameter name * * @param string $parameter44Name Parameter name * @return $this Fluent Builder */ public function setParameter44Name(string $parameter44Name): self { $this->options['parameter44Name'] = $parameter44Name; return $this; } /** * Parameter value * * @param string $parameter44Value Parameter value * @return $this Fluent Builder */ public function setParameter44Value(string $parameter44Value): self { $this->options['parameter44Value'] = $parameter44Value; return $this; } /** * Parameter name * * @param string $parameter45Name Parameter name * @return $this Fluent Builder */ public function setParameter45Name(string $parameter45Name): self { $this->options['parameter45Name'] = $parameter45Name; return $this; } /** * Parameter value * * @param string $parameter45Value Parameter value * @return $this Fluent Builder */ public function setParameter45Value(string $parameter45Value): self { $this->options['parameter45Value'] = $parameter45Value; return $this; } /** * Parameter name * * @param string $parameter46Name Parameter name * @return $this Fluent Builder */ public function setParameter46Name(string $parameter46Name): self { $this->options['parameter46Name'] = $parameter46Name; return $this; } /** * Parameter value * * @param string $parameter46Value Parameter value * @return $this Fluent Builder */ public function setParameter46Value(string $parameter46Value): self { $this->options['parameter46Value'] = $parameter46Value; return $this; } /** * Parameter name * * @param string $parameter47Name Parameter name * @return $this Fluent Builder */ public function setParameter47Name(string $parameter47Name): self { $this->options['parameter47Name'] = $parameter47Name; return $this; } /** * Parameter value * * @param string $parameter47Value Parameter value * @return $this Fluent Builder */ public function setParameter47Value(string $parameter47Value): self { $this->options['parameter47Value'] = $parameter47Value; return $this; } /** * Parameter name * * @param string $parameter48Name Parameter name * @return $this Fluent Builder */ public function setParameter48Name(string $parameter48Name): self { $this->options['parameter48Name'] = $parameter48Name; return $this; } /** * Parameter value * * @param string $parameter48Value Parameter value * @return $this Fluent Builder */ public function setParameter48Value(string $parameter48Value): self { $this->options['parameter48Value'] = $parameter48Value; return $this; } /** * Parameter name * * @param string $parameter49Name Parameter name * @return $this Fluent Builder */ public function setParameter49Name(string $parameter49Name): self { $this->options['parameter49Name'] = $parameter49Name; return $this; } /** * Parameter value * * @param string $parameter49Value Parameter value * @return $this Fluent Builder */ public function setParameter49Value(string $parameter49Value): self { $this->options['parameter49Value'] = $parameter49Value; return $this; } /** * Parameter name * * @param string $parameter50Name Parameter name * @return $this Fluent Builder */ public function setParameter50Name(string $parameter50Name): self { $this->options['parameter50Name'] = $parameter50Name; return $this; } /** * Parameter value * * @param string $parameter50Value Parameter value * @return $this Fluent Builder */ public function setParameter50Value(string $parameter50Value): self { $this->options['parameter50Value'] = $parameter50Value; return $this; } /** * Parameter name * * @param string $parameter51Name Parameter name * @return $this Fluent Builder */ public function setParameter51Name(string $parameter51Name): self { $this->options['parameter51Name'] = $parameter51Name; return $this; } /** * Parameter value * * @param string $parameter51Value Parameter value * @return $this Fluent Builder */ public function setParameter51Value(string $parameter51Value): self { $this->options['parameter51Value'] = $parameter51Value; return $this; } /** * Parameter name * * @param string $parameter52Name Parameter name * @return $this Fluent Builder */ public function setParameter52Name(string $parameter52Name): self { $this->options['parameter52Name'] = $parameter52Name; return $this; } /** * Parameter value * * @param string $parameter52Value Parameter value * @return $this Fluent Builder */ public function setParameter52Value(string $parameter52Value): self { $this->options['parameter52Value'] = $parameter52Value; return $this; } /** * Parameter name * * @param string $parameter53Name Parameter name * @return $this Fluent Builder */ public function setParameter53Name(string $parameter53Name): self { $this->options['parameter53Name'] = $parameter53Name; return $this; } /** * Parameter value * * @param string $parameter53Value Parameter value * @return $this Fluent Builder */ public function setParameter53Value(string $parameter53Value): self { $this->options['parameter53Value'] = $parameter53Value; return $this; } /** * Parameter name * * @param string $parameter54Name Parameter name * @return $this Fluent Builder */ public function setParameter54Name(string $parameter54Name): self { $this->options['parameter54Name'] = $parameter54Name; return $this; } /** * Parameter value * * @param string $parameter54Value Parameter value * @return $this Fluent Builder */ public function setParameter54Value(string $parameter54Value): self { $this->options['parameter54Value'] = $parameter54Value; return $this; } /** * Parameter name * * @param string $parameter55Name Parameter name * @return $this Fluent Builder */ public function setParameter55Name(string $parameter55Name): self { $this->options['parameter55Name'] = $parameter55Name; return $this; } /** * Parameter value * * @param string $parameter55Value Parameter value * @return $this Fluent Builder */ public function setParameter55Value(string $parameter55Value): self { $this->options['parameter55Value'] = $parameter55Value; return $this; } /** * Parameter name * * @param string $parameter56Name Parameter name * @return $this Fluent Builder */ public function setParameter56Name(string $parameter56Name): self { $this->options['parameter56Name'] = $parameter56Name; return $this; } /** * Parameter value * * @param string $parameter56Value Parameter value * @return $this Fluent Builder */ public function setParameter56Value(string $parameter56Value): self { $this->options['parameter56Value'] = $parameter56Value; return $this; } /** * Parameter name * * @param string $parameter57Name Parameter name * @return $this Fluent Builder */ public function setParameter57Name(string $parameter57Name): self { $this->options['parameter57Name'] = $parameter57Name; return $this; } /** * Parameter value * * @param string $parameter57Value Parameter value * @return $this Fluent Builder */ public function setParameter57Value(string $parameter57Value): self { $this->options['parameter57Value'] = $parameter57Value; return $this; } /** * Parameter name * * @param string $parameter58Name Parameter name * @return $this Fluent Builder */ public function setParameter58Name(string $parameter58Name): self { $this->options['parameter58Name'] = $parameter58Name; return $this; } /** * Parameter value * * @param string $parameter58Value Parameter value * @return $this Fluent Builder */ public function setParameter58Value(string $parameter58Value): self { $this->options['parameter58Value'] = $parameter58Value; return $this; } /** * Parameter name * * @param string $parameter59Name Parameter name * @return $this Fluent Builder */ public function setParameter59Name(string $parameter59Name): self { $this->options['parameter59Name'] = $parameter59Name; return $this; } /** * Parameter value * * @param string $parameter59Value Parameter value * @return $this Fluent Builder */ public function setParameter59Value(string $parameter59Value): self { $this->options['parameter59Value'] = $parameter59Value; return $this; } /** * Parameter name * * @param string $parameter60Name Parameter name * @return $this Fluent Builder */ public function setParameter60Name(string $parameter60Name): self { $this->options['parameter60Name'] = $parameter60Name; return $this; } /** * Parameter value * * @param string $parameter60Value Parameter value * @return $this Fluent Builder */ public function setParameter60Value(string $parameter60Value): self { $this->options['parameter60Value'] = $parameter60Value; return $this; } /** * Parameter name * * @param string $parameter61Name Parameter name * @return $this Fluent Builder */ public function setParameter61Name(string $parameter61Name): self { $this->options['parameter61Name'] = $parameter61Name; return $this; } /** * Parameter value * * @param string $parameter61Value Parameter value * @return $this Fluent Builder */ public function setParameter61Value(string $parameter61Value): self { $this->options['parameter61Value'] = $parameter61Value; return $this; } /** * Parameter name * * @param string $parameter62Name Parameter name * @return $this Fluent Builder */ public function setParameter62Name(string $parameter62Name): self { $this->options['parameter62Name'] = $parameter62Name; return $this; } /** * Parameter value * * @param string $parameter62Value Parameter value * @return $this Fluent Builder */ public function setParameter62Value(string $parameter62Value): self { $this->options['parameter62Value'] = $parameter62Value; return $this; } /** * Parameter name * * @param string $parameter63Name Parameter name * @return $this Fluent Builder */ public function setParameter63Name(string $parameter63Name): self { $this->options['parameter63Name'] = $parameter63Name; return $this; } /** * Parameter value * * @param string $parameter63Value Parameter value * @return $this Fluent Builder */ public function setParameter63Value(string $parameter63Value): self { $this->options['parameter63Value'] = $parameter63Value; return $this; } /** * Parameter name * * @param string $parameter64Name Parameter name * @return $this Fluent Builder */ public function setParameter64Name(string $parameter64Name): self { $this->options['parameter64Name'] = $parameter64Name; return $this; } /** * Parameter value * * @param string $parameter64Value Parameter value * @return $this Fluent Builder */ public function setParameter64Value(string $parameter64Value): self { $this->options['parameter64Value'] = $parameter64Value; return $this; } /** * Parameter name * * @param string $parameter65Name Parameter name * @return $this Fluent Builder */ public function setParameter65Name(string $parameter65Name): self { $this->options['parameter65Name'] = $parameter65Name; return $this; } /** * Parameter value * * @param string $parameter65Value Parameter value * @return $this Fluent Builder */ public function setParameter65Value(string $parameter65Value): self { $this->options['parameter65Value'] = $parameter65Value; return $this; } /** * Parameter name * * @param string $parameter66Name Parameter name * @return $this Fluent Builder */ public function setParameter66Name(string $parameter66Name): self { $this->options['parameter66Name'] = $parameter66Name; return $this; } /** * Parameter value * * @param string $parameter66Value Parameter value * @return $this Fluent Builder */ public function setParameter66Value(string $parameter66Value): self { $this->options['parameter66Value'] = $parameter66Value; return $this; } /** * Parameter name * * @param string $parameter67Name Parameter name * @return $this Fluent Builder */ public function setParameter67Name(string $parameter67Name): self { $this->options['parameter67Name'] = $parameter67Name; return $this; } /** * Parameter value * * @param string $parameter67Value Parameter value * @return $this Fluent Builder */ public function setParameter67Value(string $parameter67Value): self { $this->options['parameter67Value'] = $parameter67Value; return $this; } /** * Parameter name * * @param string $parameter68Name Parameter name * @return $this Fluent Builder */ public function setParameter68Name(string $parameter68Name): self { $this->options['parameter68Name'] = $parameter68Name; return $this; } /** * Parameter value * * @param string $parameter68Value Parameter value * @return $this Fluent Builder */ public function setParameter68Value(string $parameter68Value): self { $this->options['parameter68Value'] = $parameter68Value; return $this; } /** * Parameter name * * @param string $parameter69Name Parameter name * @return $this Fluent Builder */ public function setParameter69Name(string $parameter69Name): self { $this->options['parameter69Name'] = $parameter69Name; return $this; } /** * Parameter value * * @param string $parameter69Value Parameter value * @return $this Fluent Builder */ public function setParameter69Value(string $parameter69Value): self { $this->options['parameter69Value'] = $parameter69Value; return $this; } /** * Parameter name * * @param string $parameter70Name Parameter name * @return $this Fluent Builder */ public function setParameter70Name(string $parameter70Name): self { $this->options['parameter70Name'] = $parameter70Name; return $this; } /** * Parameter value * * @param string $parameter70Value Parameter value * @return $this Fluent Builder */ public function setParameter70Value(string $parameter70Value): self { $this->options['parameter70Value'] = $parameter70Value; return $this; } /** * Parameter name * * @param string $parameter71Name Parameter name * @return $this Fluent Builder */ public function setParameter71Name(string $parameter71Name): self { $this->options['parameter71Name'] = $parameter71Name; return $this; } /** * Parameter value * * @param string $parameter71Value Parameter value * @return $this Fluent Builder */ public function setParameter71Value(string $parameter71Value): self { $this->options['parameter71Value'] = $parameter71Value; return $this; } /** * Parameter name * * @param string $parameter72Name Parameter name * @return $this Fluent Builder */ public function setParameter72Name(string $parameter72Name): self { $this->options['parameter72Name'] = $parameter72Name; return $this; } /** * Parameter value * * @param string $parameter72Value Parameter value * @return $this Fluent Builder */ public function setParameter72Value(string $parameter72Value): self { $this->options['parameter72Value'] = $parameter72Value; return $this; } /** * Parameter name * * @param string $parameter73Name Parameter name * @return $this Fluent Builder */ public function setParameter73Name(string $parameter73Name): self { $this->options['parameter73Name'] = $parameter73Name; return $this; } /** * Parameter value * * @param string $parameter73Value Parameter value * @return $this Fluent Builder */ public function setParameter73Value(string $parameter73Value): self { $this->options['parameter73Value'] = $parameter73Value; return $this; } /** * Parameter name * * @param string $parameter74Name Parameter name * @return $this Fluent Builder */ public function setParameter74Name(string $parameter74Name): self { $this->options['parameter74Name'] = $parameter74Name; return $this; } /** * Parameter value * * @param string $parameter74Value Parameter value * @return $this Fluent Builder */ public function setParameter74Value(string $parameter74Value): self { $this->options['parameter74Value'] = $parameter74Value; return $this; } /** * Parameter name * * @param string $parameter75Name Parameter name * @return $this Fluent Builder */ public function setParameter75Name(string $parameter75Name): self { $this->options['parameter75Name'] = $parameter75Name; return $this; } /** * Parameter value * * @param string $parameter75Value Parameter value * @return $this Fluent Builder */ public function setParameter75Value(string $parameter75Value): self { $this->options['parameter75Value'] = $parameter75Value; return $this; } /** * Parameter name * * @param string $parameter76Name Parameter name * @return $this Fluent Builder */ public function setParameter76Name(string $parameter76Name): self { $this->options['parameter76Name'] = $parameter76Name; return $this; } /** * Parameter value * * @param string $parameter76Value Parameter value * @return $this Fluent Builder */ public function setParameter76Value(string $parameter76Value): self { $this->options['parameter76Value'] = $parameter76Value; return $this; } /** * Parameter name * * @param string $parameter77Name Parameter name * @return $this Fluent Builder */ public function setParameter77Name(string $parameter77Name): self { $this->options['parameter77Name'] = $parameter77Name; return $this; } /** * Parameter value * * @param string $parameter77Value Parameter value * @return $this Fluent Builder */ public function setParameter77Value(string $parameter77Value): self { $this->options['parameter77Value'] = $parameter77Value; return $this; } /** * Parameter name * * @param string $parameter78Name Parameter name * @return $this Fluent Builder */ public function setParameter78Name(string $parameter78Name): self { $this->options['parameter78Name'] = $parameter78Name; return $this; } /** * Parameter value * * @param string $parameter78Value Parameter value * @return $this Fluent Builder */ public function setParameter78Value(string $parameter78Value): self { $this->options['parameter78Value'] = $parameter78Value; return $this; } /** * Parameter name * * @param string $parameter79Name Parameter name * @return $this Fluent Builder */ public function setParameter79Name(string $parameter79Name): self { $this->options['parameter79Name'] = $parameter79Name; return $this; } /** * Parameter value * * @param string $parameter79Value Parameter value * @return $this Fluent Builder */ public function setParameter79Value(string $parameter79Value): self { $this->options['parameter79Value'] = $parameter79Value; return $this; } /** * Parameter name * * @param string $parameter80Name Parameter name * @return $this Fluent Builder */ public function setParameter80Name(string $parameter80Name): self { $this->options['parameter80Name'] = $parameter80Name; return $this; } /** * Parameter value * * @param string $parameter80Value Parameter value * @return $this Fluent Builder */ public function setParameter80Value(string $parameter80Value): self { $this->options['parameter80Value'] = $parameter80Value; return $this; } /** * Parameter name * * @param string $parameter81Name Parameter name * @return $this Fluent Builder */ public function setParameter81Name(string $parameter81Name): self { $this->options['parameter81Name'] = $parameter81Name; return $this; } /** * Parameter value * * @param string $parameter81Value Parameter value * @return $this Fluent Builder */ public function setParameter81Value(string $parameter81Value): self { $this->options['parameter81Value'] = $parameter81Value; return $this; } /** * Parameter name * * @param string $parameter82Name Parameter name * @return $this Fluent Builder */ public function setParameter82Name(string $parameter82Name): self { $this->options['parameter82Name'] = $parameter82Name; return $this; } /** * Parameter value * * @param string $parameter82Value Parameter value * @return $this Fluent Builder */ public function setParameter82Value(string $parameter82Value): self { $this->options['parameter82Value'] = $parameter82Value; return $this; } /** * Parameter name * * @param string $parameter83Name Parameter name * @return $this Fluent Builder */ public function setParameter83Name(string $parameter83Name): self { $this->options['parameter83Name'] = $parameter83Name; return $this; } /** * Parameter value * * @param string $parameter83Value Parameter value * @return $this Fluent Builder */ public function setParameter83Value(string $parameter83Value): self { $this->options['parameter83Value'] = $parameter83Value; return $this; } /** * Parameter name * * @param string $parameter84Name Parameter name * @return $this Fluent Builder */ public function setParameter84Name(string $parameter84Name): self { $this->options['parameter84Name'] = $parameter84Name; return $this; } /** * Parameter value * * @param string $parameter84Value Parameter value * @return $this Fluent Builder */ public function setParameter84Value(string $parameter84Value): self { $this->options['parameter84Value'] = $parameter84Value; return $this; } /** * Parameter name * * @param string $parameter85Name Parameter name * @return $this Fluent Builder */ public function setParameter85Name(string $parameter85Name): self { $this->options['parameter85Name'] = $parameter85Name; return $this; } /** * Parameter value * * @param string $parameter85Value Parameter value * @return $this Fluent Builder */ public function setParameter85Value(string $parameter85Value): self { $this->options['parameter85Value'] = $parameter85Value; return $this; } /** * Parameter name * * @param string $parameter86Name Parameter name * @return $this Fluent Builder */ public function setParameter86Name(string $parameter86Name): self { $this->options['parameter86Name'] = $parameter86Name; return $this; } /** * Parameter value * * @param string $parameter86Value Parameter value * @return $this Fluent Builder */ public function setParameter86Value(string $parameter86Value): self { $this->options['parameter86Value'] = $parameter86Value; return $this; } /** * Parameter name * * @param string $parameter87Name Parameter name * @return $this Fluent Builder */ public function setParameter87Name(string $parameter87Name): self { $this->options['parameter87Name'] = $parameter87Name; return $this; } /** * Parameter value * * @param string $parameter87Value Parameter value * @return $this Fluent Builder */ public function setParameter87Value(string $parameter87Value): self { $this->options['parameter87Value'] = $parameter87Value; return $this; } /** * Parameter name * * @param string $parameter88Name Parameter name * @return $this Fluent Builder */ public function setParameter88Name(string $parameter88Name): self { $this->options['parameter88Name'] = $parameter88Name; return $this; } /** * Parameter value * * @param string $parameter88Value Parameter value * @return $this Fluent Builder */ public function setParameter88Value(string $parameter88Value): self { $this->options['parameter88Value'] = $parameter88Value; return $this; } /** * Parameter name * * @param string $parameter89Name Parameter name * @return $this Fluent Builder */ public function setParameter89Name(string $parameter89Name): self { $this->options['parameter89Name'] = $parameter89Name; return $this; } /** * Parameter value * * @param string $parameter89Value Parameter value * @return $this Fluent Builder */ public function setParameter89Value(string $parameter89Value): self { $this->options['parameter89Value'] = $parameter89Value; return $this; } /** * Parameter name * * @param string $parameter90Name Parameter name * @return $this Fluent Builder */ public function setParameter90Name(string $parameter90Name): self { $this->options['parameter90Name'] = $parameter90Name; return $this; } /** * Parameter value * * @param string $parameter90Value Parameter value * @return $this Fluent Builder */ public function setParameter90Value(string $parameter90Value): self { $this->options['parameter90Value'] = $parameter90Value; return $this; } /** * Parameter name * * @param string $parameter91Name Parameter name * @return $this Fluent Builder */ public function setParameter91Name(string $parameter91Name): self { $this->options['parameter91Name'] = $parameter91Name; return $this; } /** * Parameter value * * @param string $parameter91Value Parameter value * @return $this Fluent Builder */ public function setParameter91Value(string $parameter91Value): self { $this->options['parameter91Value'] = $parameter91Value; return $this; } /** * Parameter name * * @param string $parameter92Name Parameter name * @return $this Fluent Builder */ public function setParameter92Name(string $parameter92Name): self { $this->options['parameter92Name'] = $parameter92Name; return $this; } /** * Parameter value * * @param string $parameter92Value Parameter value * @return $this Fluent Builder */ public function setParameter92Value(string $parameter92Value): self { $this->options['parameter92Value'] = $parameter92Value; return $this; } /** * Parameter name * * @param string $parameter93Name Parameter name * @return $this Fluent Builder */ public function setParameter93Name(string $parameter93Name): self { $this->options['parameter93Name'] = $parameter93Name; return $this; } /** * Parameter value * * @param string $parameter93Value Parameter value * @return $this Fluent Builder */ public function setParameter93Value(string $parameter93Value): self { $this->options['parameter93Value'] = $parameter93Value; return $this; } /** * Parameter name * * @param string $parameter94Name Parameter name * @return $this Fluent Builder */ public function setParameter94Name(string $parameter94Name): self { $this->options['parameter94Name'] = $parameter94Name; return $this; } /** * Parameter value * * @param string $parameter94Value Parameter value * @return $this Fluent Builder */ public function setParameter94Value(string $parameter94Value): self { $this->options['parameter94Value'] = $parameter94Value; return $this; } /** * Parameter name * * @param string $parameter95Name Parameter name * @return $this Fluent Builder */ public function setParameter95Name(string $parameter95Name): self { $this->options['parameter95Name'] = $parameter95Name; return $this; } /** * Parameter value * * @param string $parameter95Value Parameter value * @return $this Fluent Builder */ public function setParameter95Value(string $parameter95Value): self { $this->options['parameter95Value'] = $parameter95Value; return $this; } /** * Parameter name * * @param string $parameter96Name Parameter name * @return $this Fluent Builder */ public function setParameter96Name(string $parameter96Name): self { $this->options['parameter96Name'] = $parameter96Name; return $this; } /** * Parameter value * * @param string $parameter96Value Parameter value * @return $this Fluent Builder */ public function setParameter96Value(string $parameter96Value): self { $this->options['parameter96Value'] = $parameter96Value; return $this; } /** * Parameter name * * @param string $parameter97Name Parameter name * @return $this Fluent Builder */ public function setParameter97Name(string $parameter97Name): self { $this->options['parameter97Name'] = $parameter97Name; return $this; } /** * Parameter value * * @param string $parameter97Value Parameter value * @return $this Fluent Builder */ public function setParameter97Value(string $parameter97Value): self { $this->options['parameter97Value'] = $parameter97Value; return $this; } /** * Parameter name * * @param string $parameter98Name Parameter name * @return $this Fluent Builder */ public function setParameter98Name(string $parameter98Name): self { $this->options['parameter98Name'] = $parameter98Name; return $this; } /** * Parameter value * * @param string $parameter98Value Parameter value * @return $this Fluent Builder */ public function setParameter98Value(string $parameter98Value): self { $this->options['parameter98Value'] = $parameter98Value; return $this; } /** * Parameter name * * @param string $parameter99Name Parameter name * @return $this Fluent Builder */ public function setParameter99Name(string $parameter99Name): self { $this->options['parameter99Name'] = $parameter99Name; return $this; } /** * Parameter value * * @param string $parameter99Value Parameter value * @return $this Fluent Builder */ public function setParameter99Value(string $parameter99Value): self { $this->options['parameter99Value'] = $parameter99Value; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateSiprecOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.php000064400000007057150364341760017563 0ustar00options['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` where `1` represents very poor call quality and `5` represents a perfect call. * @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 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`. * @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 . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackList.php000064400000003444150364341760017037 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackContext.php000064400000006122150364341760017544 0ustar00solution = [ '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'] ); } /** * 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' => $options['issue'], ]); $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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecInstance.php000064400000010261150364341760017424 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'name' => Values::array_get($payload, 'name'), 'status' => Values::array_get($payload, 'status'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SiprecContext Context for this SiprecInstance */ protected function proxy(): SiprecContext { if (!$this->context) { $this->context = new SiprecContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the SiprecInstance * * @param string $status * @return SiprecInstance Updated SiprecInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): SiprecInstance { return $this->proxy()->update($status); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.SiprecInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php000064400000004464150364341760017270 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecContext.php000064400000005330150364341760017305 0ustar00solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Siprec/' . \rawurlencode($sid) .'.json'; } /** * Update the SiprecInstance * * @param string $status * @return SiprecInstance Updated SiprecInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): SiprecInstance { $data = Values::of([ 'Status' => $status, ]); $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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipList.php000064400000010445150364341760015232 0ustar00solution = [ 'accountSid' => $accountSid, ]; } /** * Access the domains */ protected function getDomains(): DomainList { if (!$this->_domains) { $this->_domains = new DomainList( $this->version, $this->solution['accountSid'] ); } return $this->_domains; } /** * Access the credentialLists */ protected function getCredentialLists(): CredentialListList { if (!$this->_credentialLists) { $this->_credentialLists = new CredentialListList( $this->version, $this->solution['accountSid'] ); } return $this->_credentialLists; } /** * Access the ipAccessControlLists */ protected function getIpAccessControlLists(): IpAccessControlListList { if (!$this->_ipAccessControlLists) { $this->_ipAccessControlLists = new IpAccessControlListList( $this->version, $this->solution['accountSid'] ); } return $this->_ipAccessControlLists; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SipList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php000064400000012222150364341760017355 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'authorizeRedirectUrl' => Values::array_get($payload, 'authorize_redirect_url'), 'companyName' => Values::array_get($payload, 'company_name'), 'deauthorizeCallbackMethod' => Values::array_get($payload, 'deauthorize_callback_method'), 'deauthorizeCallbackUrl' => Values::array_get($payload, 'deauthorize_callback_url'), 'description' => Values::array_get($payload, 'description'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'homepageUrl' => Values::array_get($payload, 'homepage_url'), 'permissions' => Values::array_get($payload, 'permissions'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConnectAppContext Context for this ConnectAppInstance */ protected function proxy(): ConnectAppContext { if (!$this->context) { $this->context = new ConnectAppContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ConnectAppInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ConnectAppInstance * * @return ConnectAppInstance Fetched ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectAppInstance { return $this->proxy()->fetch(); } /** * Update the ConnectAppInstance * * @param array|Options $options Optional Arguments * @return ConnectAppInstance Updated ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectAppInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConnectAppInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php000064400000003154150364341760017632 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php000064400000155234150364341760021133 0ustar00options['phoneNumber'] = $phoneNumber; $this->options['areaCode'] = $areaCode; $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). * * @param string $areaCode The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). * @return $this Fluent Builder */ public function setAreaCode(string $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. * * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateIncomingPhoneNumberOptions ' . $options . ']'; } } class ReadIncomingPhoneNumberOptions extends Options { /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ public function __construct( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the IncomingPhoneNumber resources to read. * * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin(string $origin): self { $this->options['origin'] = $origin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadIncomingPhoneNumberOptions ' . $options . ']'; } } class UpdateIncomingPhoneNumberOptions extends Options { /** * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ public function __construct( string $accountSid = Values::NONE, string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $bundleSid = Values::NONE ) { $this->options['accountSid'] = $accountSid; $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['bundleSid'] = $bundleSid; } /** * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from this phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateIncomingPhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageInstance.php000064400000014533150364341760016716 0ustar00properties = [ 'body' => Values::array_get($payload, 'body'), 'numSegments' => Values::array_get($payload, 'num_segments'), 'direction' => Values::array_get($payload, 'direction'), 'from' => Values::array_get($payload, 'from'), 'to' => Values::array_get($payload, 'to'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'price' => Values::array_get($payload, 'price'), 'errorMessage' => Values::array_get($payload, 'error_message'), 'uri' => Values::array_get($payload, 'uri'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'numMedia' => Values::array_get($payload, 'num_media'), 'status' => Values::array_get($payload, 'status'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateSent' => Deserialize::dateTime(Values::array_get($payload, 'date_sent')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'errorCode' => Values::array_get($payload, 'error_code'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Access the feedback */ protected function getFeedback(): FeedbackList { return $this->proxy()->feedback; } /** * Access the media */ protected function getMedia(): MediaList { return $this->proxy()->media; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php000064400000013256150364341760020573 0ustar00solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AuthorizedConnectApps.json'; } /** * Reads AuthorizedConnectAppInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthorizedConnectAppInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AuthorizedConnectAppInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthorizedConnectAppInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthorizedConnectAppPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthorizedConnectAppPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthorizedConnectAppInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance */ public function getPage(string $targetUrl): AuthorizedConnectAppPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthorizedConnectAppPage($this->version, $response, $this->solution); } /** * Constructs a AuthorizedConnectAppContext * * @param string $connectAppSid The SID of the Connect App to fetch. */ public function getContext( string $connectAppSid ): AuthorizedConnectAppContext { return new AuthorizedConnectAppContext( $this->version, $this->solution['accountSid'], $connectAppSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthorizedConnectAppList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalanceInstance.php000064400000004467150364341760016664 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Api/V2010/AccountOptions.php000064400000014224150364341760015216 0ustar00options['friendlyName'] = $friendlyName; } /** * A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` * * @param string $friendlyName A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateAccountOptions ' . $options . ']'; } } class ReadAccountOptions extends Options { /** * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. */ public function __construct( string $friendlyName = Values::NONE, string $status = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * Only return the Account resources with friendly names that exactly match this name. * * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. * * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadAccountOptions ' . $options . ']'; } } class UpdateAccountOptions extends Options { /** * @param string $friendlyName Update the human-readable description of this Account * @param string $status */ public function __construct( string $friendlyName = Values::NONE, string $status = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * Update the human-readable description of this Account * * @param string $friendlyName Update the human-readable description of this Account * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateAccountOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountPage.php000064400000003007150364341760014434 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Api/V2010/AccountList.php000064400000014165150364341760014502 0ustar00solution = [ ]; $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 ); } /** * Reads AccountInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AccountInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AccountInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AccountInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AccountPage Page of AccountInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AccountPage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AccountPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AccountInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AccountPage Page of AccountInstance */ public function getPage(string $targetUrl): AccountPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AccountPage($this->version, $response, $this->solution); } /** * Constructs a AccountContext * * @param string $sid The Account Sid that uniquely identifies the account to fetch */ public function getContext( string $sid ): AccountContext { return new AccountContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AccountList]'; } } sdk/src/Twilio/Rest/Api/V2010/AccountInstance.php000064400000023767150364341760015343 0ustar00properties = [ 'authToken' => Values::array_get($payload, 'auth_token'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'ownerAccountSid' => Values::array_get($payload, 'owner_account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AccountContext Context for this AccountInstance */ protected function proxy(): AccountContext { if (!$this->context) { $this->context = new AccountContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the AccountInstance * * @return AccountInstance Fetched AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccountInstance { return $this->proxy()->fetch(); } /** * Update the AccountInstance * * @param array|Options $options Optional Arguments * @return AccountInstance Updated AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AccountInstance { return $this->proxy()->update($options); } /** * Access the recordings */ protected function getRecordings(): RecordingList { return $this->proxy()->recordings; } /** * Access the usage */ protected function getUsage(): UsageList { return $this->proxy()->usage; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the keys */ protected function getKeys(): KeyList { return $this->proxy()->keys; } /** * Access the newKeys */ protected function getNewKeys(): NewKeyList { return $this->proxy()->newKeys; } /** * Access the applications */ protected function getApplications(): ApplicationList { return $this->proxy()->applications; } /** * Access the incomingPhoneNumbers */ protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList { return $this->proxy()->incomingPhoneNumbers; } /** * Access the conferences */ protected function getConferences(): ConferenceList { return $this->proxy()->conferences; } /** * Access the calls */ protected function getCalls(): CallList { return $this->proxy()->calls; } /** * Access the outgoingCallerIds */ protected function getOutgoingCallerIds(): OutgoingCallerIdList { return $this->proxy()->outgoingCallerIds; } /** * Access the validationRequests */ protected function getValidationRequests(): ValidationRequestList { return $this->proxy()->validationRequests; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { return $this->proxy()->transcriptions; } /** * Access the connectApps */ protected function getConnectApps(): ConnectAppList { return $this->proxy()->connectApps; } /** * Access the authorizedConnectApps */ protected function getAuthorizedConnectApps(): AuthorizedConnectAppList { return $this->proxy()->authorizedConnectApps; } /** * Access the tokens */ protected function getTokens(): TokenList { return $this->proxy()->tokens; } /** * Access the balance */ protected function getBalance(): BalanceList { return $this->proxy()->balance; } /** * Access the sip */ protected function getSip(): SipList { return $this->proxy()->sip; } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Access the availablePhoneNumbers */ protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList { return $this->proxy()->availablePhoneNumbers; } /** * Access the addresses */ protected function getAddresses(): AddressList { return $this->proxy()->addresses; } /** * Access the queues */ protected function getQueues(): QueueList { return $this->proxy()->queues; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { return $this->proxy()->shortCodes; } /** * Access the signingKeys */ protected function getSigningKeys(): SigningKeyList { return $this->proxy()->signingKeys; } /** * Access the newSigningKeys */ protected function getNewSigningKeys(): NewSigningKeyList { return $this->proxy()->newSigningKeys; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AccountInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountContext.php000064400000040101150364341760015200 0ustar00solution = [ '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 recordings */ protected function getRecordings(): RecordingList { if (!$this->_recordings) { $this->_recordings = new RecordingList( $this->version, $this->solution['sid'] ); } return $this->_recordings; } /** * Access the usage */ protected function getUsage(): UsageList { if (!$this->_usage) { $this->_usage = new UsageList( $this->version, $this->solution['sid'] ); } return $this->_usage; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['sid'] ); } return $this->_messages; } /** * Access the keys */ protected function getKeys(): KeyList { if (!$this->_keys) { $this->_keys = new KeyList( $this->version, $this->solution['sid'] ); } return $this->_keys; } /** * Access the newKeys */ protected function getNewKeys(): NewKeyList { if (!$this->_newKeys) { $this->_newKeys = new NewKeyList( $this->version, $this->solution['sid'] ); } return $this->_newKeys; } /** * Access the applications */ protected function getApplications(): ApplicationList { if (!$this->_applications) { $this->_applications = new ApplicationList( $this->version, $this->solution['sid'] ); } return $this->_applications; } /** * Access the incomingPhoneNumbers */ protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList { if (!$this->_incomingPhoneNumbers) { $this->_incomingPhoneNumbers = new IncomingPhoneNumberList( $this->version, $this->solution['sid'] ); } return $this->_incomingPhoneNumbers; } /** * Access the conferences */ protected function getConferences(): ConferenceList { if (!$this->_conferences) { $this->_conferences = new ConferenceList( $this->version, $this->solution['sid'] ); } return $this->_conferences; } /** * Access the calls */ protected function getCalls(): CallList { if (!$this->_calls) { $this->_calls = new CallList( $this->version, $this->solution['sid'] ); } return $this->_calls; } /** * Access the outgoingCallerIds */ protected function getOutgoingCallerIds(): OutgoingCallerIdList { if (!$this->_outgoingCallerIds) { $this->_outgoingCallerIds = new OutgoingCallerIdList( $this->version, $this->solution['sid'] ); } return $this->_outgoingCallerIds; } /** * Access the validationRequests */ protected function getValidationRequests(): ValidationRequestList { if (!$this->_validationRequests) { $this->_validationRequests = new ValidationRequestList( $this->version, $this->solution['sid'] ); } return $this->_validationRequests; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { if (!$this->_transcriptions) { $this->_transcriptions = new TranscriptionList( $this->version, $this->solution['sid'] ); } return $this->_transcriptions; } /** * Access the connectApps */ protected function getConnectApps(): ConnectAppList { if (!$this->_connectApps) { $this->_connectApps = new ConnectAppList( $this->version, $this->solution['sid'] ); } return $this->_connectApps; } /** * Access the authorizedConnectApps */ protected function getAuthorizedConnectApps(): AuthorizedConnectAppList { if (!$this->_authorizedConnectApps) { $this->_authorizedConnectApps = new AuthorizedConnectAppList( $this->version, $this->solution['sid'] ); } return $this->_authorizedConnectApps; } /** * Access the tokens */ protected function getTokens(): TokenList { if (!$this->_tokens) { $this->_tokens = new TokenList( $this->version, $this->solution['sid'] ); } return $this->_tokens; } /** * Access the balance */ protected function getBalance(): BalanceList { if (!$this->_balance) { $this->_balance = new BalanceList( $this->version, $this->solution['sid'] ); } return $this->_balance; } /** * Access the sip */ protected function getSip(): SipList { if (!$this->_sip) { $this->_sip = new SipList( $this->version, $this->solution['sid'] ); } return $this->_sip; } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['sid'] ); } return $this->_notifications; } /** * Access the availablePhoneNumbers */ protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList { if (!$this->_availablePhoneNumbers) { $this->_availablePhoneNumbers = new AvailablePhoneNumberCountryList( $this->version, $this->solution['sid'] ); } return $this->_availablePhoneNumbers; } /** * Access the addresses */ protected function getAddresses(): AddressList { if (!$this->_addresses) { $this->_addresses = new AddressList( $this->version, $this->solution['sid'] ); } return $this->_addresses; } /** * Access the queues */ protected function getQueues(): QueueList { if (!$this->_queues) { $this->_queues = new QueueList( $this->version, $this->solution['sid'] ); } return $this->_queues; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList( $this->version, $this->solution['sid'] ); } return $this->_shortCodes; } /** * Access the signingKeys */ protected function getSigningKeys(): SigningKeyList { if (!$this->_signingKeys) { $this->_signingKeys = new SigningKeyList( $this->version, $this->solution['sid'] ); } return $this->_signingKeys; } /** * Access the newSigningKeys */ protected function getNewSigningKeys(): NewSigningKeyList { if (!$this->_newSigningKeys) { $this->_newSigningKeys = new NewSigningKeyList( $this->version, $this->solution['sid'] ); } return $this->_newSigningKeys; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AccountContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010.php000064400000025420150364341760012246 0ustar00version = '2010-04-01'; } protected function getAccounts(): AccountList { if (!$this->_accounts) { $this->_accounts = new AccountList($this); } return $this->_accounts; } /** * @return AccountContext Account provided as the authenticating account */ protected function getAccount(): AccountContext { if (!$this->_account) { $this->_account = new AccountContext( $this, $this->domain->getClient()->getAccountSid() ); } return $this->_account; } /** * Setter to override the primary account * * @param AccountContext|AccountInstance $account account to use as the primary * account */ public function setAccount($account): void { $this->_account = $account; } protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { return $this->account->recordings; } protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { return $this->account->usage; } protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { return $this->account->messages; } protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { return $this->account->keys; } protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { return $this->account->newKeys; } protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { return $this->account->applications; } protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { return $this->account->incomingPhoneNumbers; } protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { return $this->account->conferences; } protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { return $this->account->calls; } protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { return $this->account->outgoingCallerIds; } protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { return $this->account->validationRequests; } protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { return $this->account->transcriptions; } protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { return $this->account->connectApps; } protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { return $this->account->authorizedConnectApps; } protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { return $this->account->tokens; } protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { return $this->account->balance; } protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { return $this->account->sip; } protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { return $this->account->notifications; } protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { return $this->account->availablePhoneNumbers; } protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { return $this->account->addresses; } protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { return $this->account->queues; } protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { return $this->account->shortCodes; } protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { return $this->account->signingKeys; } protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { return $this->account->newSigningKeys; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010]'; } } sdk/src/Twilio/Rest/Oauth.php000064400000004131150364341760012101 0ustar00oauth instead. */ protected function getOauth(): \Twilio\Rest\Oauth\V1\OauthList { echo "oauth is deprecated. Use v1->oauth instead."; return $this->v1->oauth; } /** * @deprecated Use v1->oauth() instead. */ protected function contextOauth(): \Twilio\Rest\Oauth\V1\OauthContext { echo "oauth() is deprecated. Use v1->oauth() instead."; return $this->v1->oauth(); } /** * @deprecated Use v1->deviceCode instead. */ protected function getDeviceCode(): \Twilio\Rest\Oauth\V1\DeviceCodeList { echo "deviceCode is deprecated. Use v1->deviceCode instead."; return $this->v1->deviceCode; } /** * @deprecated Use v1->openidDiscovery instead. */ protected function getOpenidDiscovery(): \Twilio\Rest\Oauth\V1\OpenidDiscoveryList { echo "openidDiscovery is deprecated. Use v1->openidDiscovery instead."; return $this->v1->openidDiscovery; } /** * @deprecated Use v1->openidDiscovery() instead. */ protected function contextOpenidDiscovery(): \Twilio\Rest\Oauth\V1\OpenidDiscoveryContext { echo "openidDiscovery() is deprecated. Use v1->openidDiscovery() instead."; return $this->v1->openidDiscovery(); } /** * @deprecated Use v1->token instead. */ protected function getToken(): \Twilio\Rest\Oauth\V1\TokenList { echo "token is deprecated. Use v1->token instead."; return $this->v1->token; } /** * @deprecated Use v1->userInfo instead. */ protected function getUserInfo(): \Twilio\Rest\Oauth\V1\UserInfoList { echo "userInfo is deprecated. Use v1->userInfo instead."; return $this->v1->userInfo; } /** * @deprecated Use v1->userInfo() instead. */ protected function contextUserInfo(): \Twilio\Rest\Oauth\V1\UserInfoContext { echo "userInfo() is deprecated. Use v1->userInfo() instead."; return $this->v1->userInfo(); } }sdk/src/Twilio/Rest/Bulkexports/V1.php000064400000005755150364341760013646 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationPage.php000064400000003146150364341760020444 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationInstance.php000064400000010124150364341760021326 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php000064400000006112150364341760021210 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationList.php000064400000003113150364341760020475 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportList.php000064400000006135150364341760015754 0ustar00solution = [ ]; } /** * Constructs a ExportContext * * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants */ public function getContext( string $resourceType ): ExportContext { return new ExportContext( $this->version, $resourceType ); } /** * Access the jobs */ protected function getJobs(): JobList { if (!$this->_jobs) { $this->_jobs = new JobList( $this->version ); } return $this->_jobs; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportList]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php000064400000004340150364341760017176 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobOptions.php000064400000011471150364341760021602 0ustar00options['webhookUrl'] = $webhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['email'] = $email; } /** * The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. * * @param string $webhookUrl The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. * * @param string $webhookMethod This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. * * @param string $email The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Bulkexports.V1.CreateExportCustomJobOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobInstance.php000064400000010760150364341760017316 0ustar00properties = [ 'resourceType' => Values::array_get($payload, 'resource_type'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'details' => Values::array_get($payload, 'details'), 'startDay' => Values::array_get($payload, 'start_day'), 'endDay' => Values::array_get($payload, 'end_day'), 'jobSid' => Values::array_get($payload, 'job_sid'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'email' => Values::array_get($payload, 'email'), 'url' => Values::array_get($payload, 'url'), 'jobQueuePosition' => Values::array_get($payload, 'job_queue_position'), 'estimatedCompletionTime' => Values::array_get($payload, 'estimated_completion_time'), ]; $this->solution = ['jobSid' => $jobSid ?: $this->properties['jobSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return JobContext Context for this JobInstance */ protected function proxy(): JobContext { if (!$this->context) { $this->context = new JobContext( $this->version, $this->solution['jobSid'] ); } return $this->context; } /** * Delete the JobInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the JobInstance * * @return JobInstance Fetched JobInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): JobInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.JobInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayInstance.php000064400000007377150364341760017333 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobList.php000064400000015170150364341760021062 0ustar00solution = [ 'resourceType' => $resourceType, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) .'/Jobs'; } /** * Create the ExportCustomJobInstance * * @param string $startDay The start day for the custom export specified as a string in the format of yyyy-mm-dd * @param string $endDay The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day is inclusive and must be 2 days earlier than the current UTC day. * @param string $friendlyName The friendly name specified when creating the job * @param array|Options $options Optional Arguments * @return ExportCustomJobInstance Created ExportCustomJobInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $startDay, string $endDay, string $friendlyName, array $options = []): ExportCustomJobInstance { $options = new Values($options); $data = Values::of([ 'StartDay' => $startDay, 'EndDay' => $endDay, 'FriendlyName' => $friendlyName, 'WebhookUrl' => $options['webhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'Email' => $options['email'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExportCustomJobInstance( $this->version, $payload, $this->solution['resourceType'] ); } /** * Reads ExportCustomJobInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExportCustomJobInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ExportCustomJobInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExportCustomJobInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExportCustomJobPage Page of ExportCustomJobInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExportCustomJobPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExportCustomJobPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExportCustomJobInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExportCustomJobPage Page of ExportCustomJobInstance */ public function getPage(string $targetUrl): ExportCustomJobPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExportCustomJobPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportCustomJobList]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayList.php000064400000012501150364341760016463 0ustar00solution = [ 'resourceType' => $resourceType, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) .'/Days'; } /** * Reads DayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DayInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DayInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DayPage Page of DayInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DayPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DayPage Page of DayInstance */ public function getPage(string $targetUrl): DayPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DayPage($this->version, $response, $this->solution); } /** * Constructs a DayContext * * @param string $day The ISO 8601 format date of the resources in the file, for a UTC day */ public function getContext( string $day ): DayContext { return new DayContext( $this->version, $this->solution['resourceType'], $day ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.DayList]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobPage.php000064400000003024150364341760016421 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobInstance.php000064400000006435150364341760021717 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php000064400000004372150364341760017200 0ustar00solution = [ 'jobSid' => $jobSid, ]; $this->uri = '/Exports/Jobs/' . \rawurlencode($jobSid) .''; } /** * Delete the JobInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobList.php000064400000002732150364341760016465 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobPage.php000064400000003175150364341760021025 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayPage.php000064400000003065150364341760016431 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationOptions.php000064400000007660150364341760021230 0ustar00options['enabled'] = $enabled; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookMethod'] = $webhookMethod; } /** * If true, Twilio will automatically generate every day's file when the day is over. * * @param bool $enabled If true, Twilio will automatically generate every day's file when the day is over. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Stores the URL destination for the method specified in webhook_method. * * @param string $webhookUrl Stores the URL destination for the method specified in webhook_method. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url * * @param string $webhookMethod Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Bulkexports.V1.UpdateExportConfigurationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportPage.php000064400000003030150364341760015704 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportInstance.php000064400000007420150364341760016603 0ustar00properties = [ 'resourceType' => Values::array_get($payload, 'resource_type'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['resourceType' => $resourceType ?: $this->properties['resourceType'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExportContext Context for this ExportInstance */ protected function proxy(): ExportContext { if (!$this->context) { $this->context = new ExportContext( $this->version, $this->solution['resourceType'] ); } return $this->context; } /** * Fetch the ExportInstance * * @return ExportInstance Fetched ExportInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExportInstance { return $this->proxy()->fetch(); } /** * Access the exportCustomJobs */ protected function getExportCustomJobs(): ExportCustomJobList { return $this->proxy()->exportCustomJobs; } /** * Access the days */ protected function getDays(): DayList { return $this->proxy()->days; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.ExportInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportContext.php000064400000010207150364341760016460 0ustar00solution = [ '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 exportCustomJobs */ protected function getExportCustomJobs(): ExportCustomJobList { if (!$this->_exportCustomJobs) { $this->_exportCustomJobs = new ExportCustomJobList( $this->version, $this->solution['resourceType'] ); } return $this->_exportCustomJobs; } /** * Access the days */ protected function getDays(): DayList { if (!$this->_days) { $this->_days = new DayList( $this->version, $this->solution['resourceType'] ); } return $this->_days; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.ExportContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/StudioBase.php000064400000005164150364341760013072 0ustar00baseUrl = 'https://studio.twilio.com'; } /** * @return V1 Version v1 of studio */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of studio */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio]'; } } sdk/src/Twilio/Rest/IntelligenceBase.php000064400000004574150364341760014231 0ustar00baseUrl = 'https://intelligence.twilio.com'; } /** * @return V2 Version v2 of intelligence */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence]'; } } sdk/src/Twilio/Rest/MonitorBase.php000064400000004531150364341760013247 0ustar00baseUrl = 'https://monitor.twilio.com'; } /** * @return V1 Version v1 of monitor */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Monitor]'; } } sdk/src/Twilio/Rest/IpMessaging.php000064400000002426150364341760013234 0ustar00credentials instead. */ protected function getCredentials(): \Twilio\Rest\IpMessaging\V2\CredentialList { echo "credentials is deprecated. Use v2->credentials instead."; return $this->v2->credentials; } /** * @deprecated Use v2->credentials(\$sid) instead. * @param string $sid The sid */ protected function contextCredentials(string $sid): \Twilio\Rest\IpMessaging\V2\CredentialContext { echo "credentials(\$sid) is deprecated. Use v2->credentials(\$sid) instead."; return $this->v2->credentials($sid); } /** * @deprecated Use v2->services instead. */ protected function getServices(): \Twilio\Rest\IpMessaging\V2\ServiceList { echo "services is deprecated. Use v2->services instead."; return $this->v2->services; } /** * @deprecated Use v2->services(\$sid) instead. * @param string $sid The sid */ protected function contextServices(string $sid): \Twilio\Rest\IpMessaging\V2\ServiceContext { echo "services($sid) is deprecated. Use v2->services(\$sid) instead."; return $this->v2->services($sid); } }sdk/src/Twilio/Rest/EventsBase.php000064400000004522150364341760013064 0ustar00baseUrl = 'https://events.twilio.com'; } /** * @return V1 Version v1 of events */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events]'; } } sdk/src/Twilio/Rest/InsightsBase.php000064400000004540150364341760013410 0ustar00baseUrl = 'https://insights.twilio.com'; } /** * @return V1 Version v1 of insights */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights]'; } } sdk/src/Twilio/Rest/FlexApiBase.php000064400000005201150364341760013143 0ustar00baseUrl = 'https://flex-api.twilio.com'; } /** * @return V1 Version v1 of flex-api */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of flex-api */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi]'; } } sdk/src/Twilio/Rest/Conversations/V1.php000064400000012652150364341760014153 0ustar00version = 'v1'; } protected function getAddressConfigurations(): AddressConfigurationList { if (!$this->_addressConfigurations) { $this->_addressConfigurations = new AddressConfigurationList($this); } return $this->_addressConfigurations; } protected function getConfiguration(): ConfigurationList { if (!$this->_configuration) { $this->_configuration = new ConfigurationList($this); } return $this->_configuration; } protected function getConversations(): ConversationList { if (!$this->_conversations) { $this->_conversations = new ConversationList($this); } return $this->_conversations; } protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } protected function getParticipantConversations(): ParticipantConversationList { if (!$this->_participantConversations) { $this->_participantConversations = new ParticipantConversationList($this); } return $this->_participantConversations; } protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList($this); } return $this->_roles; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList($this); } return $this->_users; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1]'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php000064400000010057150364341760021632 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Configuration/Addresses/' . \rawurlencode($sid) .''; } /** * Delete the AddressConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/RoleInstance.php000064400000011621150364341760016534 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/RoleInstance.php000064400000012267150364341760020143 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserContext.php000064400000013240150364341760020030 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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'] ); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/RoleList.php000064400000015135150364341760017307 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $type * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The SID of the Role resource to delete. */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['chatServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.RoleList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationList.php000064400000013414150364341760023255 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/ParticipantConversations'; } /** * Reads ParticipantConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantConversationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ParticipantConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantConversationPage Page of ParticipantConversationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantConversationPage { $options = new Values($options); $params = Values::of([ 'Identity' => $options['identity'], 'Address' => $options['address'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantConversationPage Page of ParticipantConversationInstance */ public function getPage(string $targetUrl): ParticipantConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantConversationPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php000064400000005133150364341760020466 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserOptions.php000064400000023542150364341760020045 0ustar00options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateUserOptions ' . $options . ']'; } } class DeleteUserOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationInstance.php000064400000010567150364341760024114 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserPage.php000064400000003107150364341760017261 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationInstance.php000064400000014533150364341760021712 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'state' => Values::array_get($payload, 'state'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'timers' => Values::array_get($payload, 'timers'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'bindings' => Values::array_get($payload, 'bindings'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConversationContext Context for this ConversationInstance */ protected function proxy(): ConversationContext { if (!$this->context) { $this->context = new ConversationContext( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ConversationInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ConversationInstance * * @return ConversationInstance Fetched ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConversationInstance { return $this->proxy()->fetch(); } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConversationInstance { return $this->proxy()->update($options); } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationOptions.php000064400000015535150364341760021741 0ustar00options['defaultConversationCreatorRoleSid'] = $defaultConversationCreatorRoleSid; $this->options['defaultConversationRoleSid'] = $defaultConversationRoleSid; $this->options['defaultChatServiceRoleSid'] = $defaultChatServiceRoleSid; $this->options['reachabilityEnabled'] = $reachabilityEnabled; } /** * The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultConversationCreatorRoleSid The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultConversationCreatorRoleSid(string $defaultConversationCreatorRoleSid): self { $this->options['defaultConversationCreatorRoleSid'] = $defaultConversationCreatorRoleSid; return $this; } /** * The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultConversationRoleSid The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultConversationRoleSid(string $defaultConversationRoleSid): self { $this->options['defaultConversationRoleSid'] = $defaultConversationRoleSid; return $this; } /** * The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultChatServiceRoleSid The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultChatServiceRoleSid(string $defaultChatServiceRoleSid): self { $this->options['defaultChatServiceRoleSid'] = $defaultChatServiceRoleSid; return $this; } /** * Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. * * @param bool $reachabilityEnabled Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateConfigurationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookList.php000064400000003260150364341760022607 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookOptions.php000064400000014360150364341760023332 0ustar00options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['filters'] = $filters; $this->options['method'] = $method; } /** * The absolute url the pre-event webhook request should be sent to. * * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The absolute url the post-event webhook request should be sent to. * * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. * * @param string[] $filters The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. * @return $this Fluent Builder */ public function setFilters(array $filters): self { $this->options['filters'] = $filters; return $this; } /** * The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. * * @param string $method The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php000064400000006165150364341760023327 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Configuration/Webhooks'; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'Filters' => Serialize::map($options['filters'], function ($e) { return $e; }), 'Method' => $options['method'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationList.php000064400000003310150364341760023633 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookInstance.php000064400000010270150364341760023437 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'filters' => Values::array_get($payload, 'filters'), 'method' => Values::array_get($payload, 'method'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['chatServiceSid'] ); } return $this->context; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationInstance.php000064400000010477150364341760024500 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'newMessage' => Values::array_get($payload, 'new_message'), 'addedToConversation' => Values::array_get($payload, 'added_to_conversation'), 'removedFromConversation' => Values::array_get($payload, 'removed_from_conversation'), 'logEnabled' => Values::array_get($payload, 'log_enabled'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NotificationContext Context for this NotificationInstance */ protected function proxy(): NotificationContext { if (!$this->context) { $this->context = new NotificationContext( $this->version, $this->solution['chatServiceSid'] ); } return $this->context; } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { return $this->proxy()->fetch(); } /** * Update the NotificationInstance * * @param array|Options $options Optional Arguments * @return NotificationInstance Updated NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): NotificationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.NotificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationPage.php000064400000003223150364341760023577 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationOptions.php000064400000037032150364341760024363 0ustar00options['logEnabled'] = $logEnabled; $this->options['newMessageEnabled'] = $newMessageEnabled; $this->options['newMessageTemplate'] = $newMessageTemplate; $this->options['newMessageSound'] = $newMessageSound; $this->options['newMessageBadgeCountEnabled'] = $newMessageBadgeCountEnabled; $this->options['addedToConversationEnabled'] = $addedToConversationEnabled; $this->options['addedToConversationTemplate'] = $addedToConversationTemplate; $this->options['addedToConversationSound'] = $addedToConversationSound; $this->options['removedFromConversationEnabled'] = $removedFromConversationEnabled; $this->options['removedFromConversationTemplate'] = $removedFromConversationTemplate; $this->options['removedFromConversationSound'] = $removedFromConversationSound; $this->options['newMessageWithMediaEnabled'] = $newMessageWithMediaEnabled; $this->options['newMessageWithMediaTemplate'] = $newMessageWithMediaTemplate; } /** * Weather the notification logging is enabled. * * @param bool $logEnabled Weather the notification logging is enabled. * @return $this Fluent Builder */ public function setLogEnabled(bool $logEnabled): self { $this->options['logEnabled'] = $logEnabled; return $this; } /** * Whether to send a notification when a new message is added to a conversation. The default is `false`. * * @param bool $newMessageEnabled Whether to send a notification when a new message is added to a conversation. The default is `false`. * @return $this Fluent Builder */ public function setNewMessageEnabled(bool $newMessageEnabled): self { $this->options['newMessageEnabled'] = $newMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. * * @param string $newMessageTemplate The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNewMessageTemplate(string $newMessageTemplate): self { $this->options['newMessageTemplate'] = $newMessageTemplate; return $this; } /** * The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. * * @param string $newMessageSound The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNewMessageSound(string $newMessageSound): self { $this->options['newMessageSound'] = $newMessageSound; return $this; } /** * Whether the new message badge is enabled. The default is `false`. * * @param bool $newMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. * @return $this Fluent Builder */ public function setNewMessageBadgeCountEnabled(bool $newMessageBadgeCountEnabled): self { $this->options['newMessageBadgeCountEnabled'] = $newMessageBadgeCountEnabled; return $this; } /** * Whether to send a notification when a participant is added to a conversation. The default is `false`. * * @param bool $addedToConversationEnabled Whether to send a notification when a participant is added to a conversation. The default is `false`. * @return $this Fluent Builder */ public function setAddedToConversationEnabled(bool $addedToConversationEnabled): self { $this->options['addedToConversationEnabled'] = $addedToConversationEnabled; return $this; } /** * The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * * @param string $addedToConversationTemplate The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * @return $this Fluent Builder */ public function setAddedToConversationTemplate(string $addedToConversationTemplate): self { $this->options['addedToConversationTemplate'] = $addedToConversationTemplate; return $this; } /** * The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * * @param string $addedToConversationSound The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * @return $this Fluent Builder */ public function setAddedToConversationSound(string $addedToConversationSound): self { $this->options['addedToConversationSound'] = $addedToConversationSound; return $this; } /** * Whether to send a notification to a user when they are removed from a conversation. The default is `false`. * * @param bool $removedFromConversationEnabled Whether to send a notification to a user when they are removed from a conversation. The default is `false`. * @return $this Fluent Builder */ public function setRemovedFromConversationEnabled(bool $removedFromConversationEnabled): self { $this->options['removedFromConversationEnabled'] = $removedFromConversationEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * * @param string $removedFromConversationTemplate The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * @return $this Fluent Builder */ public function setRemovedFromConversationTemplate(string $removedFromConversationTemplate): self { $this->options['removedFromConversationTemplate'] = $removedFromConversationTemplate; return $this; } /** * The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * * @param string $removedFromConversationSound The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * @return $this Fluent Builder */ public function setRemovedFromConversationSound(string $removedFromConversationSound): self { $this->options['removedFromConversationSound'] = $removedFromConversationSound; return $this; } /** * Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. * * @param bool $newMessageWithMediaEnabled Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. * @return $this Fluent Builder */ public function setNewMessageWithMediaEnabled(bool $newMessageWithMediaEnabled): self { $this->options['newMessageWithMediaEnabled'] = $newMessageWithMediaEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. * * @param string $newMessageWithMediaTemplate The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. * @return $this Fluent Builder */ public function setNewMessageWithMediaTemplate(string $newMessageWithMediaTemplate): self { $this->options['newMessageWithMediaTemplate'] = $newMessageWithMediaTemplate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookPage.php000064400000003165150364341760022554 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php000064400000010401150364341760024343 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Configuration/Notifications'; } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { $payload = $this->version->fetch('GET', $this->uri); return new NotificationInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Update the NotificationInstance * * @param array|Options $options Optional Arguments * @return NotificationInstance Updated NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): NotificationInstance { $options = new Values($options); $data = Values::of([ 'LogEnabled' => Serialize::booleanToString($options['logEnabled']), 'NewMessage.Enabled' => Serialize::booleanToString($options['newMessageEnabled']), 'NewMessage.Template' => $options['newMessageTemplate'], 'NewMessage.Sound' => $options['newMessageSound'], 'NewMessage.BadgeCountEnabled' => Serialize::booleanToString($options['newMessageBadgeCountEnabled']), 'AddedToConversation.Enabled' => Serialize::booleanToString($options['addedToConversationEnabled']), 'AddedToConversation.Template' => $options['addedToConversationTemplate'], 'AddedToConversation.Sound' => $options['addedToConversationSound'], 'RemovedFromConversation.Enabled' => Serialize::booleanToString($options['removedFromConversationEnabled']), 'RemovedFromConversation.Template' => $options['removedFromConversationTemplate'], 'RemovedFromConversation.Sound' => $options['removedFromConversationSound'], 'NewMessage.WithMedia.Enabled' => Serialize::booleanToString($options['newMessageWithMediaEnabled']), 'NewMessage.WithMedia.Template' => $options['newMessageWithMediaTemplate'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationPage.php000064400000003167150364341760021023 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationPage.php000064400000003175150364341760021157 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserInstance.php000064400000013243150364341760020153 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userConversations */ protected function getUserConversations(): UserConversationList { return $this->proxy()->userConversations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationList.php000064400000017311150364341760021056 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations'; } /** * Create the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Created ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ConversationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'State' => $options['state'], 'Timers.Inactive' => $options['timersInactive'], 'Timers.Closed' => $options['timersClosed'], 'Bindings.Email.Address' => $options['bindingsEmailAddress'], 'Bindings.Email.Name' => $options['bindingsEmailName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Reads ConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConversationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConversationPage Page of ConversationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConversationPage { $options = new Values($options); $params = Values::of([ 'StartDate' => $options['startDate'], 'EndDate' => $options['endDate'], 'State' => $options['state'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConversationPage Page of ConversationInstance */ public function getPage(string $targetUrl): ConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConversationPage($this->version, $response, $this->solution); } /** * Constructs a ConversationContext * * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. */ public function getContext( string $sid ): ConversationContext { return new ConversationContext( $this->version, $this->solution['chatServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php000064400000006306150364341760021726 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php000064400000007243150364341760020021 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php000064400000017061150364341760021571 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($sid) .''; } /** * Delete the ConversationInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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'] ); } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConversationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'State' => $options['state'], 'Timers.Inactive' => $options['timersInactive'], 'Timers.Closed' => $options['timersClosed'], 'UniqueName' => $options['uniqueName'], 'Bindings.Email.Address' => $options['bindingsEmailAddress'], 'Bindings.Email.Name' => $options['bindingsEmailName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->_participants; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationList.php000064400000007670150364341760021222 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, ]; } /** * Constructs a ConfigurationContext */ public function getContext( ): ConfigurationContext { return new ConfigurationContext( $this->version, $this->solution['chatServiceSid'] ); } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['chatServiceSid'] ); } return $this->_notifications; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['chatServiceSid'] ); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConfigurationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingOptions.php000064400000007577150364341760020513 0ustar00options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. * * @param string[] $identity The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationPage.php000064400000003271150364341760023216 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingInstance.php000064400000011337150364341760020611 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationInstance.php000064400000010547150364341760022050 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php000064400000070203150364341760021575 0ustar00options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['state'] = $state; $this->options['timersInactive'] = $timersInactive; $this->options['timersClosed'] = $timersClosed; $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; $this->options['bindingsEmailName'] = $bindingsEmailName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setTimersInactive(string $timersInactive): self { $this->options['timersInactive'] = $timersInactive; return $this; } /** * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; return $this; } /** * The default email address that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailAddress(string $bindingsEmailAddress): self { $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; return $this; } /** * The default name that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailName(string $bindingsEmailName): self { $this->options['bindingsEmailName'] = $bindingsEmailName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateConversationOptions ' . $options . ']'; } } class DeleteConversationOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteConversationOptions ' . $options . ']'; } } class ReadConversationOptions extends Options { /** * @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ public function __construct( string $startDate = Values::NONE, string $endDate = Values::NONE, string $state = Values::NONE ) { $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['state'] = $state; } /** * Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * * @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * @return $this Fluent Builder */ public function setStartDate(string $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * * @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * @return $this Fluent Builder */ public function setEndDate(string $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadConversationOptions ' . $options . ']'; } } class UpdateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $uniqueName = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['state'] = $state; $this->options['timersInactive'] = $timersInactive; $this->options['timersClosed'] = $timersClosed; $this->options['uniqueName'] = $uniqueName; $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; $this->options['bindingsEmailName'] = $bindingsEmailName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setTimersInactive(string $timersInactive): self { $this->options['timersInactive'] = $timersInactive; return $this; } /** * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The default email address that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailAddress(string $bindingsEmailAddress): self { $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; return $this; } /** * The default name that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailName(string $bindingsEmailName): self { $this->options['bindingsEmailName'] = $bindingsEmailName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php000064400000010514150364341760023342 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Users/' . \rawurlencode($userSid) .'/Conversations/' . \rawurlencode($conversationSid) .''; } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationList.php000064400000014306150364341760022634 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Users/' . \rawurlencode($userSid) .'/Conversations'; } /** * Reads UserConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserConversationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserConversationPage Page of UserConversationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserConversationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserConversationPage Page of UserConversationInstance */ public function getPage(string $targetUrl): UserConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserConversationPage($this->version, $response, $this->solution); } /** * Constructs a UserConversationContext * * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). */ public function getContext( string $conversationSid ): UserConversationContext { return new UserConversationContext( $this->version, $this->solution['chatServiceSid'], $this->solution['userSid'], $conversationSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationPage.php000064400000003265150364341760022577 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationOptions.php000064400000007215150364341760023355 0ustar00options['notificationLevel'] = $notificationLevel; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; } /** * @param string $notificationLevel * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The date of the last message read in conversation by the user, given in ISO 8601 format. * * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. * @return $this Fluent Builder */ public function setLastReadTimestamp(\DateTime $lastReadTimestamp): self { $this->options['lastReadTimestamp'] = $lastReadTimestamp; return $this; } /** * The index of the last Message in the Conversation that the Participant has read. * * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. * @return $this Fluent Builder */ public function setLastReadMessageIndex(int $lastReadMessageIndex): self { $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateUserConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationInstance.php000064400000015143150364341760023465 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'conversationState' => Values::array_get($payload, 'conversation_state'), 'timers' => Values::array_get($payload, 'timers'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, 'conversationSid' => $conversationSid ?: $this->properties['conversationSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserConversationContext Context for this UserConversationInstance */ protected function proxy(): UserConversationContext { if (!$this->context) { $this->context = new UserConversationContext( $this->version, $this->solution['chatServiceSid'], $this->solution['userSid'], $this->solution['conversationSid'] ); } return $this->context; } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserConversationInstance * * @return UserConversationInstance Fetched UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserConversationInstance { return $this->proxy()->fetch(); } /** * Update the UserConversationInstance * * @param array|Options $options Optional Arguments * @return UserConversationInstance Updated UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserConversationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationOptions.php000064400000010157150364341760023776 0ustar00options['identity'] = $identity; $this->options['address'] = $address; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * @return $this Fluent Builder */ public function setAddress(string $address): self { $this->options['address'] = $address; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadParticipantConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserList.php000064400000015403150364341760017322 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity The application-defined string that uniquely identifies the resource's User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'RoleSid' => $options['roleSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['chatServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.php000064400000045540150364341760023167 0ustar00options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['mediaSid'] = $mediaSid; $this->options['contentSid'] = $contentSid; $this->options['contentVariables'] = $contentVariables; $this->options['subject'] = $subject; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @return $this Fluent Builder */ public function setAuthor(string $author): self { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message, can be up to 1,600 characters long. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The Media SID to be attached to the new Message. * * @param string $mediaSid The Media SID to be attached to the new Message. * @return $this Fluent Builder */ public function setMediaSid(string $mediaSid): self { $this->options['mediaSid'] = $mediaSid; return $this; } /** * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-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](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. * @return $this Fluent Builder */ public function setContentSid(string $contentSid): self { $this->options['contentSid'] = $contentSid; return $this; } /** * A structurally valid JSON string that contains values to resolve Rich Content template variables. * * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. * @return $this Fluent Builder */ public function setContentVariables(string $contentVariables): self { $this->options['contentVariables'] = $contentVariables; return $this; } /** * The subject of the message, can be up to 256 characters long. * * @param string $subject The subject of the message, can be up to 256 characters long. * @return $this Fluent Builder */ public function setSubject(string $subject): self { $this->options['subject'] = $subject; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateMessageOptions ' . $options . ']'; } } class DeleteMessageOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['subject'] = $subject; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @return $this Fluent Builder */ public function setAuthor(string $author): self { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message, can be up to 1,600 characters long. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The subject of the message, can be up to 256 characters long. * * @param string $subject The subject of the message, can be up to 256 characters long. * @return $this Fluent Builder */ public function setSubject(string $subject): self { $this->options['subject'] = $subject; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php000064400000011570150364341760024046 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Participants/' . \rawurlencode($sid) .''; } /** * Delete the ParticipantInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookList.php000064400000016425150364341760022461 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $target * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $target, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Target' => $target, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.ReplayAfter' => $options['configurationReplayAfter'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookOptions.php000064400000025110150364341760023170 0ustar00options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationReplayAfter'] = $configurationReplayAfter; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow SID, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The message index for which and it's successors the webhook will be replayed. Not set by default * * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default * @return $this Fluent Builder */ public function setConfigurationReplayAfter(int $configurationReplayAfter): self { $this->options['configurationReplayAfter'] = $configurationReplayAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow SID, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php000064400000012411150364341760026366 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php000064400000003366150364341760025507 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php000064400000014552150364341760025545 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($messageSid) .'/Receipts'; } /** * Reads DeliveryReceiptInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeliveryReceiptInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeliveryReceiptInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeliveryReceiptInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeliveryReceiptPage Page of DeliveryReceiptInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeliveryReceiptPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeliveryReceiptPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeliveryReceiptInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeliveryReceiptPage Page of DeliveryReceiptInstance */ public function getPage(string $targetUrl): DeliveryReceiptPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeliveryReceiptPage($this->version, $response, $this->solution); } /** * Constructs a DeliveryReceiptContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): DeliveryReceiptContext { return new DeliveryReceiptContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['messageSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.DeliveryReceiptList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php000064400000006145150364341760026255 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php000064400000010350150364341760023161 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantInstance.php000064400000013504150364341760024165 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'attributes' => Values::array_get($payload, 'attributes'), 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), 'lastReadTimestamp' => Values::array_get($payload, 'last_read_timestamp'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ParticipantContext Context for this ParticipantInstance */ protected function proxy(): ParticipantContext { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ParticipantInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantPage.php000064400000003257150364341760023301 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantOptions.php000064400000060552150364341760024061 0ustar00options['identity'] = $identity; $this->options['messagingBindingAddress'] = $messagingBindingAddress; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * @return $this Fluent Builder */ public function setMessagingBindingAddress(string $messagingBindingAddress): self { $this->options['messagingBindingAddress'] = $messagingBindingAddress; return $this; } /** * The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The date on which this resource was created. * * @param \DateTime $dateCreated The date on which this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date on which this resource was last updated. * * @param \DateTime $dateUpdated The date on which this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. * * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; return $this; } /** * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateParticipantOptions ' . $options . ']'; } } class DeleteParticipantOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteParticipantOptions ' . $options . ']'; } } class UpdateParticipantOptions extends Options { /** * @param \DateTime $dateCreated The date on which this resource was created. * @param \DateTime $dateUpdated The date on which this resource was last updated. * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $identity = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, int $lastReadMessageIndex = Values::INT_NONE, string $lastReadTimestamp = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['identity'] = $identity; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The date on which this resource was created. * * @param \DateTime $dateCreated The date on which this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date on which this resource was last updated. * * @param \DateTime $dateUpdated The date on which this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; return $this; } /** * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @return $this Fluent Builder */ public function setLastReadMessageIndex(int $lastReadMessageIndex): self { $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; return $this; } /** * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @return $this Fluent Builder */ public function setLastReadTimestamp(string $lastReadTimestamp): self { $this->options['lastReadTimestamp'] = $lastReadTimestamp; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookInstance.php000064400000012300150364341760023276 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessagePage.php000064400000003227150364341760022404 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php000064400000014566150364341760023164 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'Subject' => $options['subject'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Access the deliveryReceipts */ protected function getDeliveryReceipts(): DeliveryReceiptList { if (!$this->_deliveryReceipts) { $this->_deliveryReceipts = new DeliveryReceiptList( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->_deliveryReceipts; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookPage.php000064400000003227150364341760022416 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageList.php000064400000017156150364341760022451 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Messages'; } /** * Create the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MediaSid' => $options['mediaSid'], 'ContentSid' => $options['contentSid'], 'ContentVariables' => $options['contentVariables'], 'Subject' => $options['subject'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.MessageList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantList.php000064400000016731150364341760023341 0ustar00solution = [ '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'] ); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageInstance.php000064400000014355150364341760023300 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'index' => Values::array_get($payload, 'index'), 'author' => Values::array_get($payload, 'author'), 'body' => Values::array_get($payload, 'body'), 'media' => Values::array_get($payload, 'media'), 'attributes' => Values::array_get($payload, 'attributes'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'delivery' => Values::array_get($payload, 'delivery'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'contentSid' => Values::array_get($payload, 'content_sid'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Access the deliveryReceipts */ protected function getDeliveryReceipts(): DeliveryReceiptList { return $this->proxy()->deliveryReceipts; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingList.php000064400000013633150364341760017761 0ustar00solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Bindings'; } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BindingPage Page of BindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BindingPage Page of BindingInstance */ public function getPage(string $targetUrl): BindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid The SID of the Binding resource to delete. */ public function getContext( string $sid ): BindingContext { return new BindingContext( $this->version, $this->solution['chatServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.BindingList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingPage.php000064400000003131150364341760017712 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/RolePage.php000064400000003107150364341760017244 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/UserContext.php000064400000012275150364341760016437 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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'] ); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php000064400000053401150364341760021641 0ustar00options['friendlyName'] = $friendlyName; $this->options['autoCreationEnabled'] = $autoCreationEnabled; $this->options['autoCreationType'] = $autoCreationType; $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; $this->options['addressCountry'] = $addressCountry; } /** * The human-readable name of this configuration, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Enable/Disable auto-creating conversations for messages to this address * * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @return $this Fluent Builder */ public function setAutoCreationEnabled(bool $autoCreationEnabled): self { $this->options['autoCreationEnabled'] = $autoCreationEnabled; return $this; } /** * @param string $autoCreationType * @return $this Fluent Builder */ public function setAutoCreationType(string $autoCreationType): self { $this->options['autoCreationType'] = $autoCreationType; return $this; } /** * Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @return $this Fluent Builder */ public function setAutoCreationConversationServiceSid(string $autoCreationConversationServiceSid): self { $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; return $this; } /** * For type `webhook`, the url for the webhook request. * * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @return $this Fluent Builder */ public function setAutoCreationWebhookUrl(string $autoCreationWebhookUrl): self { $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; return $this; } /** * @param string $autoCreationWebhookMethod * @return $this Fluent Builder */ public function setAutoCreationWebhookMethod(string $autoCreationWebhookMethod): self { $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @return $this Fluent Builder */ public function setAutoCreationWebhookFilters(array $autoCreationWebhookFilters): self { $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; return $this; } /** * For type `studio`, the studio flow SID where the webhook should be sent to. * * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @return $this Fluent Builder */ public function setAutoCreationStudioFlowSid(string $autoCreationStudioFlowSid): self { $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; return $this; } /** * For type `studio`, number of times to retry the webhook request * * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request * @return $this Fluent Builder */ public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCount): self { $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; return $this; } /** * An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. * * @param string $addressCountry An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. * @return $this Fluent Builder */ public function setAddressCountry(string $addressCountry): self { $this->options['addressCountry'] = $addressCountry; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateAddressConfigurationOptions ' . $options . ']'; } } class ReadAddressConfigurationOptions extends Options { /** * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. */ public function __construct( string $type = Values::NONE ) { $this->options['type'] = $type; } /** * Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. * * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadAddressConfigurationOptions ' . $options . ']'; } } class UpdateAddressConfigurationOptions extends Options { /** * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @param string $autoCreationType * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @param string $autoCreationWebhookMethod * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request */ public function __construct( string $friendlyName = Values::NONE, bool $autoCreationEnabled = Values::BOOL_NONE, string $autoCreationType = Values::NONE, string $autoCreationConversationServiceSid = Values::NONE, string $autoCreationWebhookUrl = Values::NONE, string $autoCreationWebhookMethod = Values::NONE, array $autoCreationWebhookFilters = Values::ARRAY_NONE, string $autoCreationStudioFlowSid = Values::NONE, int $autoCreationStudioRetryCount = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['autoCreationEnabled'] = $autoCreationEnabled; $this->options['autoCreationType'] = $autoCreationType; $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; } /** * The human-readable name of this configuration, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Enable/Disable auto-creating conversations for messages to this address * * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @return $this Fluent Builder */ public function setAutoCreationEnabled(bool $autoCreationEnabled): self { $this->options['autoCreationEnabled'] = $autoCreationEnabled; return $this; } /** * @param string $autoCreationType * @return $this Fluent Builder */ public function setAutoCreationType(string $autoCreationType): self { $this->options['autoCreationType'] = $autoCreationType; return $this; } /** * Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @return $this Fluent Builder */ public function setAutoCreationConversationServiceSid(string $autoCreationConversationServiceSid): self { $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; return $this; } /** * For type `webhook`, the url for the webhook request. * * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @return $this Fluent Builder */ public function setAutoCreationWebhookUrl(string $autoCreationWebhookUrl): self { $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; return $this; } /** * @param string $autoCreationWebhookMethod * @return $this Fluent Builder */ public function setAutoCreationWebhookMethod(string $autoCreationWebhookMethod): self { $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @return $this Fluent Builder */ public function setAutoCreationWebhookFilters(array $autoCreationWebhookFilters): self { $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; return $this; } /** * For type `studio`, the studio flow SID where the webhook should be sent to. * * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @return $this Fluent Builder */ public function setAutoCreationStudioFlowSid(string $autoCreationStudioFlowSid): self { $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; return $this; } /** * For type `studio`, number of times to retry the webhook request * * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request * @return $this Fluent Builder */ public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCount): self { $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateAddressConfigurationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/RoleList.php000064400000014260150364341760015705 0ustar00solution = [ ]; $this->uri = '/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $type * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The SID of the Role resource to delete. */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.RoleList]'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialList.php000064400000014443150364341760017061 0ustar00solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationList.php000064400000012645150364341760021662 0ustar00solution = [ ]; $this->uri = '/ParticipantConversations'; } /** * Reads ParticipantConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantConversationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ParticipantConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantConversationPage Page of ParticipantConversationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantConversationPage { $options = new Values($options); $params = Values::of([ 'Identity' => $options['identity'], 'Address' => $options['address'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantConversationPage Page of ParticipantConversationInstance */ public function getPage(string $targetUrl): ParticipantConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantConversationPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationPage.php000064400000003164150364341760021063 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/UserOptions.php000064400000023532150364341760016444 0ustar00options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateUserOptions ' . $options . ']'; } } class DeleteUserOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ServiceList.php000064400000013401150364341760016400 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName The human-readable name of this service, limited to 256 characters. Optional. * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationInstance.php000064400000010154150364341760022504 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Conversations/V1/UserPage.php000064400000003024150364341760015657 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationInstance.php000064400000014022150364341760020303 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'state' => Values::array_get($payload, 'state'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'timers' => Values::array_get($payload, 'timers'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'bindings' => Values::array_get($payload, 'bindings'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConversationContext Context for this ConversationInstance */ protected function proxy(): ConversationContext { if (!$this->context) { $this->context = new ConversationContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ConversationInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ConversationInstance * * @return ConversationInstance Fetched ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConversationInstance { return $this->proxy()->fetch(); } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConversationInstance { return $this->proxy()->update($options); } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationOptions.php000064400000013403150364341760020331 0ustar00options['defaultChatServiceSid'] = $defaultChatServiceSid; $this->options['defaultMessagingServiceSid'] = $defaultMessagingServiceSid; $this->options['defaultInactiveTimer'] = $defaultInactiveTimer; $this->options['defaultClosedTimer'] = $defaultClosedTimer; } /** * The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. * * @param string $defaultChatServiceSid The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. * @return $this Fluent Builder */ public function setDefaultChatServiceSid(string $defaultChatServiceSid): self { $this->options['defaultChatServiceSid'] = $defaultChatServiceSid; return $this; } /** * The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. * * @param string $defaultMessagingServiceSid The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. * @return $this Fluent Builder */ public function setDefaultMessagingServiceSid(string $defaultMessagingServiceSid): self { $this->options['defaultMessagingServiceSid'] = $defaultMessagingServiceSid; return $this; } /** * Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $defaultInactiveTimer Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setDefaultInactiveTimer(string $defaultInactiveTimer): self { $this->options['defaultInactiveTimer'] = $defaultInactiveTimer; return $this; } /** * Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $defaultClosedTimer Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setDefaultClosedTimer(string $defaultClosedTimer): self { $this->options['defaultClosedTimer'] = $defaultClosedTimer; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateConfigurationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookList.php000064400000002550150364341760021210 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookOptions.php000064400000012405150364341760021730 0ustar00options['method'] = $method; $this->options['filters'] = $filters; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['target'] = $target; } /** * The HTTP method to be used when sending a webhook request. * * @param string $method The HTTP method to be used when sending a webhook request. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` * * @param string[] $filters The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` * @return $this Fluent Builder */ public function setFilters(array $filters): self { $this->options['filters'] = $filters; return $this; } /** * The absolute url the pre-event webhook request should be sent to. * * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The absolute url the post-event webhook request should be sent to. * * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * @param string $target * @return $this Fluent Builder */ public function setTarget(string $target): self { $this->options['target'] = $target; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php000064400000005423150364341760021723 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookInstance.php000064400000007562150364341760022051 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookPage.php000064400000003102150364341760021143 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationPage.php000064400000003104150364341760017412 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/ServicePage.php000064400000003046150364341760016345 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialOptions.php000064400000034546150364341760017607 0ustar00options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $type * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $type = Values::NONE, string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['type'] = $type; $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationPage.php000064400000003112150364341760017546 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialInstance.php000064400000010777150364341760017720 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/UserInstance.php000064400000012562150364341760016556 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userConversations */ protected function getUserConversations(): UserConversationList { return $this->proxy()->userConversations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationList.php000064400000016421150364341760017457 0ustar00solution = [ ]; $this->uri = '/Conversations'; } /** * Create the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Created ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ConversationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'MessagingServiceSid' => $options['messagingServiceSid'], 'Attributes' => $options['attributes'], 'State' => $options['state'], 'Timers.Inactive' => $options['timersInactive'], 'Timers.Closed' => $options['timersClosed'], 'Bindings.Email.Address' => $options['bindingsEmailAddress'], 'Bindings.Email.Name' => $options['bindingsEmailName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ConversationInstance( $this->version, $payload ); } /** * Reads ConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConversationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConversationPage Page of ConversationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConversationPage { $options = new Values($options); $params = Values::of([ 'StartDate' => $options['startDate'], 'EndDate' => $options['endDate'], 'State' => $options['state'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConversationPage Page of ConversationInstance */ public function getPage(string $targetUrl): ConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConversationPage($this->version, $response, $this->solution); } /** * Constructs a ConversationContext * * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. */ public function getContext( string $sid ): ConversationContext { return new ConversationContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ServiceContext.php000064400000015071150364341760017116 0ustar00solution = [ '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 users */ protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList( $this->version, $this->solution['sid'] ); } return $this->_users; } /** * Access the bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList( $this->version, $this->solution['sid'] ); } return $this->_bindings; } /** * Access the participantConversations */ protected function getParticipantConversations(): ParticipantConversationList { if (!$this->_participantConversations) { $this->_participantConversations = new ParticipantConversationList( $this->version, $this->solution['sid'] ); } return $this->_participantConversations; } /** * Access the conversations */ protected function getConversations(): ConversationList { if (!$this->_conversations) { $this->_conversations = new ConversationList( $this->version, $this->solution['sid'] ); } return $this->_conversations; } /** * Access the roles */ protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList( $this->version, $this->solution['sid'] ); } return $this->_roles; } /** * Access the configuration */ protected function getConfiguration(): ConfigurationList { if (!$this->_configuration) { $this->_configuration = new ConfigurationList( $this->version, $this->solution['sid'] ); } return $this->_configuration; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php000064400000005444150364341760020330 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/RoleContext.php000064400000006406150364341760016421 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationInstance.php000064400000011711150364341760021750 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'type' => Values::array_get($payload, 'type'), 'address' => Values::array_get($payload, 'address'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'autoCreation' => Values::array_get($payload, 'auto_creation'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'addressCountry' => Values::array_get($payload, 'address_country'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AddressConfigurationContext Context for this AddressConfigurationInstance */ protected function proxy(): AddressConfigurationContext { if (!$this->context) { $this->context = new AddressConfigurationContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the AddressConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AddressConfigurationInstance * * @return AddressConfigurationInstance Fetched AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddressConfigurationInstance { return $this->proxy()->fetch(); } /** * Update the AddressConfigurationInstance * * @param array|Options $options Optional Arguments * @return AddressConfigurationInstance Updated AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AddressConfigurationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.AddressConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationContext.php000064400000015700150364341760020167 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($sid) .''; } /** * Delete the ConversationInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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'] ); } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConversationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'State' => $options['state'], 'Timers.Inactive' => $options['timersInactive'], 'Timers.Closed' => $options['timersClosed'], 'UniqueName' => $options['uniqueName'], 'Bindings.Email.Address' => $options['bindingsEmailAddress'], 'Bindings.Email.Name' => $options['bindingsEmailName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ConversationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['sid'] ); } return $this->_participants; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationList.php000064400000006026150364341760017614 0ustar00solution = [ ]; } /** * Constructs a ConfigurationContext */ public function getContext( ): ConfigurationContext { return new ConfigurationContext( $this->version ); } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version ); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConfigurationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationPage.php000064400000003206150364341760021614 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationInstance.php000064400000010117150364341760020441 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationOptions.php000064400000070173150364341760020203 0ustar00options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['attributes'] = $attributes; $this->options['state'] = $state; $this->options['timersInactive'] = $timersInactive; $this->options['timersClosed'] = $timersClosed; $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; $this->options['bindingsEmailName'] = $bindingsEmailName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setTimersInactive(string $timersInactive): self { $this->options['timersInactive'] = $timersInactive; return $this; } /** * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; return $this; } /** * The default email address that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailAddress(string $bindingsEmailAddress): self { $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; return $this; } /** * The default name that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailName(string $bindingsEmailName): self { $this->options['bindingsEmailName'] = $bindingsEmailName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateConversationOptions ' . $options . ']'; } } class DeleteConversationOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteConversationOptions ' . $options . ']'; } } class ReadConversationOptions extends Options { /** * @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ public function __construct( string $startDate = Values::NONE, string $endDate = Values::NONE, string $state = Values::NONE ) { $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['state'] = $state; } /** * Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * * @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * @return $this Fluent Builder */ public function setStartDate(string $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * * @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * @return $this Fluent Builder */ public function setEndDate(string $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadConversationOptions ' . $options . ']'; } } class UpdateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $uniqueName = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['state'] = $state; $this->options['timersInactive'] = $timersInactive; $this->options['timersClosed'] = $timersClosed; $this->options['uniqueName'] = $uniqueName; $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; $this->options['bindingsEmailName'] = $bindingsEmailName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setTimersInactive(string $timersInactive): self { $this->options['timersInactive'] = $timersInactive; return $this; } /** * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The default email address that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailAddress(string $bindingsEmailAddress): self { $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; return $this; } /** * The default name that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailName(string $bindingsEmailName): self { $this->options['bindingsEmailName'] = $bindingsEmailName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php000064400000007644150364341760021754 0ustar00solution = [ 'userSid' => $userSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Users/' . \rawurlencode($userSid) .'/Conversations/' . \rawurlencode($conversationSid) .''; } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationList.php000064400000013475150364341760021242 0ustar00solution = [ 'userSid' => $userSid, ]; $this->uri = '/Users/' . \rawurlencode($userSid) .'/Conversations'; } /** * Reads UserConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserConversationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserConversationPage Page of UserConversationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserConversationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserConversationPage Page of UserConversationInstance */ public function getPage(string $targetUrl): UserConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserConversationPage($this->version, $response, $this->solution); } /** * Constructs a UserConversationContext * * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). */ public function getContext( string $conversationSid ): UserConversationContext { return new UserConversationContext( $this->version, $this->solution['userSid'], $conversationSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationPage.php000064400000003202150364341760021166 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationOptions.php000064400000007205150364341760021754 0ustar00options['notificationLevel'] = $notificationLevel; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; } /** * @param string $notificationLevel * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The date of the last message read in conversation by the user, given in ISO 8601 format. * * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. * @return $this Fluent Builder */ public function setLastReadTimestamp(\DateTime $lastReadTimestamp): self { $this->options['lastReadTimestamp'] = $lastReadTimestamp; return $this; } /** * The index of the last Message in the Conversation that the Participant has read. * * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. * @return $this Fluent Builder */ public function setLastReadMessageIndex(int $lastReadMessageIndex): self { $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateUserConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationInstance.php000064400000014462150364341760022070 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'conversationState' => Values::array_get($payload, 'conversation_state'), 'timers' => Values::array_get($payload, 'timers'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['userSid' => $userSid, 'conversationSid' => $conversationSid ?: $this->properties['conversationSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserConversationContext Context for this UserConversationInstance */ protected function proxy(): UserConversationContext { if (!$this->context) { $this->context = new UserConversationContext( $this->version, $this->solution['userSid'], $this->solution['conversationSid'] ); } return $this->context; } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserConversationInstance * * @return UserConversationInstance Fetched UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserConversationInstance { return $this->proxy()->fetch(); } /** * Update the UserConversationInstance * * @param array|Options $options Optional Arguments * @return UserConversationInstance Updated UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserConversationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialPage.php000064400000003070150364341760017014 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationOptions.php000064400000010147150364341760022375 0ustar00options['identity'] = $identity; $this->options['address'] = $address; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * @return $this Fluent Builder */ public function setAddress(string $address): self { $this->options['address'] = $address; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadParticipantConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/UserList.php000064400000014523150364341760015724 0ustar00solution = [ ]; $this->uri = '/Users'; } /** * Create the UserInstance * * @param string $identity The application-defined string that uniquely identifies the resource's User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'RoleSid' => $options['roleSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserList]'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationList.php000064400000017212150364341760021121 0ustar00solution = [ ]; $this->uri = '/Configuration/Addresses'; } /** * Create the AddressConfigurationInstance * * @param string $type * @param string $address The unique address to be configured. The address can be a whatsapp address or phone number * @param array|Options $options Optional Arguments * @return AddressConfigurationInstance Created AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, string $address, array $options = []): AddressConfigurationInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'Address' => $address, 'FriendlyName' => $options['friendlyName'], 'AutoCreation.Enabled' => Serialize::booleanToString($options['autoCreationEnabled']), 'AutoCreation.Type' => $options['autoCreationType'], 'AutoCreation.ConversationServiceSid' => $options['autoCreationConversationServiceSid'], 'AutoCreation.WebhookUrl' => $options['autoCreationWebhookUrl'], 'AutoCreation.WebhookMethod' => $options['autoCreationWebhookMethod'], 'AutoCreation.WebhookFilters' => Serialize::map($options['autoCreationWebhookFilters'], function ($e) { return $e; }), 'AutoCreation.StudioFlowSid' => $options['autoCreationStudioFlowSid'], 'AutoCreation.StudioRetryCount' => $options['autoCreationStudioRetryCount'], 'AddressCountry' => $options['addressCountry'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AddressConfigurationInstance( $this->version, $payload ); } /** * Reads AddressConfigurationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AddressConfigurationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AddressConfigurationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AddressConfigurationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AddressConfigurationPage Page of AddressConfigurationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AddressConfigurationPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AddressConfigurationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AddressConfigurationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AddressConfigurationPage Page of AddressConfigurationInstance */ public function getPage(string $targetUrl): AddressConfigurationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AddressConfigurationPage($this->version, $response, $this->solution); } /** * Constructs a AddressConfigurationContext * * @param string $sid The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration */ public function getContext( string $sid ): AddressConfigurationContext { return new AddressConfigurationContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.AddressConfigurationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ServiceInstance.php000064400000012712150364341760017235 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Access the bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * Access the participantConversations */ protected function getParticipantConversations(): ParticipantConversationList { return $this->proxy()->participantConversations; } /** * Access the conversations */ protected function getConversations(): ConversationList { return $this->proxy()->conversations; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the configuration */ protected function getConfiguration(): ConfigurationList { return $this->proxy()->configuration; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php000064400000045530150364341760021566 0ustar00options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['mediaSid'] = $mediaSid; $this->options['contentSid'] = $contentSid; $this->options['contentVariables'] = $contentVariables; $this->options['subject'] = $subject; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @return $this Fluent Builder */ public function setAuthor(string $author): self { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message, can be up to 1,600 characters long. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The Media SID to be attached to the new Message. * * @param string $mediaSid The Media SID to be attached to the new Message. * @return $this Fluent Builder */ public function setMediaSid(string $mediaSid): self { $this->options['mediaSid'] = $mediaSid; return $this; } /** * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-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](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. * @return $this Fluent Builder */ public function setContentSid(string $contentSid): self { $this->options['contentSid'] = $contentSid; return $this; } /** * A structurally valid JSON string that contains values to resolve Rich Content template variables. * * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. * @return $this Fluent Builder */ public function setContentVariables(string $contentVariables): self { $this->options['contentVariables'] = $contentVariables; return $this; } /** * The subject of the message, can be up to 256 characters long. * * @param string $subject The subject of the message, can be up to 256 characters long. * @return $this Fluent Builder */ public function setSubject(string $subject): self { $this->options['subject'] = $subject; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateMessageOptions ' . $options . ']'; } } class DeleteMessageOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['subject'] = $subject; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @return $this Fluent Builder */ public function setAuthor(string $author): self { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message, can be up to 1,600 characters long. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The subject of the message, can be up to 256 characters long. * * @param string $subject The subject of the message, can be up to 256 characters long. * @return $this Fluent Builder */ public function setSubject(string $subject): self { $this->options['subject'] = $subject; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php000064400000010721150364341760022443 0ustar00solution = [ 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Participants/' . \rawurlencode($sid) .''; } /** * Delete the ParticipantInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php000064400000015536150364341760021063 0ustar00solution = [ 'conversationSid' => $conversationSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $target * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $target, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Target' => $target, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.ReplayAfter' => $options['configurationReplayAfter'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['conversationSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php000064400000025100150364341760021567 0ustar00options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationReplayAfter'] = $configurationReplayAfter; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow SID, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The message index for which and it's successors the webhook will be replayed. Not set by default * * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default * @return $this Fluent Builder */ public function setConfigurationReplayAfter(int $configurationReplayAfter): self { $this->options['configurationReplayAfter'] = $configurationReplayAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow SID, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php000064400000011543150364341760024773 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptPage.php000064400000003303150364341760024076 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptList.php000064400000013746150364341760024151 0ustar00solution = [ 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($messageSid) .'/Receipts'; } /** * Reads DeliveryReceiptInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeliveryReceiptInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeliveryReceiptInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeliveryReceiptInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeliveryReceiptPage Page of DeliveryReceiptInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeliveryReceiptPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeliveryReceiptPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeliveryReceiptInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeliveryReceiptPage Page of DeliveryReceiptInstance */ public function getPage(string $targetUrl): DeliveryReceiptPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeliveryReceiptPage($this->version, $response, $this->solution); } /** * Constructs a DeliveryReceiptContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): DeliveryReceiptContext { return new DeliveryReceiptContext( $this->version, $this->solution['conversationSid'], $this->solution['messageSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.DeliveryReceiptList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php000064400000005361150364341760024654 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php000064400000007501150364341760021565 0ustar00solution = [ 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php000064400000012632150364341760022566 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'attributes' => Values::array_get($payload, 'attributes'), 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), 'lastReadTimestamp' => Values::array_get($payload, 'last_read_timestamp'), ]; $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ParticipantContext Context for this ParticipantInstance */ protected function proxy(): ParticipantContext { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ParticipantInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php000064400000003174150364341760021677 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php000064400000060216150364341760022456 0ustar00options['identity'] = $identity; $this->options['messagingBindingAddress'] = $messagingBindingAddress; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * @return $this Fluent Builder */ public function setMessagingBindingAddress(string $messagingBindingAddress): self { $this->options['messagingBindingAddress'] = $messagingBindingAddress; return $this; } /** * The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. * * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; return $this; } /** * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateParticipantOptions ' . $options . ']'; } } class DeleteParticipantOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteParticipantOptions ' . $options . ']'; } } class UpdateParticipantOptions extends Options { /** * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $identity = Values::NONE, int $lastReadMessageIndex = Values::INT_NONE, string $lastReadTimestamp = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $this->options['identity'] = $identity; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; return $this; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @return $this Fluent Builder */ public function setLastReadMessageIndex(int $lastReadMessageIndex): self { $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; return $this; } /** * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @return $this Fluent Builder */ public function setLastReadTimestamp(string $lastReadTimestamp): self { $this->options['lastReadTimestamp'] = $lastReadTimestamp; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php000064400000011426150364341760021706 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php000064400000003144150364341760021002 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php000064400000013614150364341760021555 0ustar00solution = [ 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'Subject' => $options['subject'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Access the deliveryReceipts */ protected function getDeliveryReceipts(): DeliveryReceiptList { if (!$this->_deliveryReceipts) { $this->_deliveryReceipts = new DeliveryReceiptList( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->_deliveryReceipts; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php000064400000003144150364341760021014 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageList.php000064400000016267150364341760021053 0ustar00solution = [ 'conversationSid' => $conversationSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Messages'; } /** * Create the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MediaSid' => $options['mediaSid'], 'ContentSid' => $options['contentSid'], 'ContentVariables' => $options['contentVariables'], 'Subject' => $options['subject'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['conversationSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.MessageList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php000064400000016042150364341760021734 0ustar00solution = [ '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'] ); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php000064400000013473150364341760021700 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'index' => Values::array_get($payload, 'index'), 'author' => Values::array_get($payload, 'author'), 'body' => Values::array_get($payload, 'body'), 'media' => Values::array_get($payload, 'media'), 'attributes' => Values::array_get($payload, 'attributes'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'delivery' => Values::array_get($payload, 'delivery'), 'links' => Values::array_get($payload, 'links'), 'contentSid' => Values::array_get($payload, 'content_sid'), ]; $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Access the deliveryReceipts */ protected function getDeliveryReceipts(): DeliveryReceiptList { return $this->proxy()->deliveryReceipts; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/RolePage.php000064400000003024150364341760015642 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialContext.php000064400000006631150364341760017572 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/LookupsBase.php000064400000005176150364341760013262 0ustar00baseUrl = 'https://lookups.twilio.com'; } /** * @return V1 Version v1 of lookups */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of lookups */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups]'; } } sdk/src/Twilio/Rest/Content.php000064400000001303150364341760012431 0ustar00contents instead. */ protected function getContents(): \Twilio\Rest\Content\V1\ContentList { echo "contents is deprecated. Use v1->contents instead."; return $this->v1->contents; } /** * @deprecated Use v1->contents(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextContents(string $sid): \Twilio\Rest\Content\V1\ContentContext { echo "contents(\$sid) is deprecated. Use v1->contents(\$sid) instead."; return $this->v1->contents($sid); } }sdk/src/Twilio/Rest/Oauth/V1.php000064400000007257150364341760012403 0ustar00version = 'v1'; } protected function getDeviceCode(): DeviceCodeList { if (!$this->_deviceCode) { $this->_deviceCode = new DeviceCodeList($this); } return $this->_deviceCode; } protected function getOauth(): OauthList { if (!$this->_oauth) { $this->_oauth = new OauthList($this); } return $this->_oauth; } 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]'; } } sdk/src/Twilio/Rest/Oauth/V1/DeviceCodeOptions.php000064400000003641150364341760015742 0ustar00options['audiences'] = $audiences; } /** * An array of intended audiences for token requests * * @param string[] $audiences An array of intended audiences for token requests * @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 . ']'; } } sdk/src/Twilio/Rest/Oauth/V1/DeviceCodeInstance.php000064400000005065150364341760016055 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Oauth/V1/OauthPage.php000064400000002772150364341760014255 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Oauth/V1/OauthContext.php000064400000003344150364341760015021 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Oauth/V1/TokenPage.php000064400000002772150364341760014255 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Oauth/V1/UserInfoList.php000064400000002510150364341760014754 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Oauth/V1/TokenList.php000064400000005053150364341760014307 0ustar00solution = [ ]; $this->uri = '/token'; } /** * Create the TokenInstance * * @param string $grantType Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. * @param string $clientSid A 34 character string that uniquely identifies this OAuth App. * @param array|Options $options Optional Arguments * @return TokenInstance Created TokenInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $grantType, string $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]'; } } sdk/src/Twilio/Rest/Oauth/V1/DeviceCodeList.php000064400000004437150364341760015226 0ustar00solution = [ ]; $this->uri = '/device/code'; } /** * Create the DeviceCodeInstance * * @param string $clientSid A 34 character string that uniquely identifies this OAuth App. * @param string[] $scopes An Array of scopes for authorization request * @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]'; } } sdk/src/Twilio/Rest/Oauth/V1/OauthInstance.php000064400000005640150364341760015142 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryPage.php000064400000003066150364341760016300 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Oauth/V1/OauthList.php000064400000002466150364341760014314 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Oauth/V1/DeviceCodePage.php000064400000003030150364341760015153 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Oauth/V1/TokenInstance.php000064400000005047150364341760015143 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Oauth/V1/UserInfoContext.php000064400000003377150364341760015501 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Oauth/V1/UserInfoPage.php000064400000003014150364341760014715 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryInstance.php000064400000010757150364341760017175 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Oauth/V1/UserInfoInstance.php000064400000006555150364341760015622 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Oauth/V1/TokenOptions.php000064400000012273150364341760015031 0ustar00options['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 related to the authorization code grant type. * @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 A code which is generation cryptographically. * @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 related to the device code grant type. * @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 related to the refresh token grant type. * @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 The Id of the device associated with the token (refresh token). * @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 . ']'; } } sdk/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryList.php000064400000002562150364341760016337 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Oauth/V1/OpenidDiscoveryContext.php000064400000003517150364341760017051 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Video/V1.php000064400000011016150364341760012355 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsInstance.php000064400000010540150364341760017500 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingSettingsContext Context for this RecordingSettingsInstance */ protected function proxy(): RecordingSettingsContext { if (!$this->context) { $this->context = new RecordingSettingsContext( $this->version ); } return $this->context; } /** * Create the RecordingSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe the resource and be shown to users in the console * @param array|Options $options Optional Arguments * @return RecordingSettingsInstance Created RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): RecordingSettingsInstance { return $this->proxy()->create($friendlyName, $options); } /** * Fetch the RecordingSettingsInstance * * @return RecordingSettingsInstance Fetched RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingSettingsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingSettingsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsList.php000064400000002576150364341760016661 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.php000064400000015072150364341760017374 0ustar00RFC 3986. * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. * @return CreateRecordingSettingsOptions Options builder */ public static function create( string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::BOOL_NONE, bool $encryptionEnabled = Values::BOOL_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. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. */ public function __construct( string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::BOOL_NONE, bool $encryptionEnabled = Values::BOOL_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 RFC 3986. * * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. * @return $this Fluent Builder */ public function setAwsS3Url(string $awsS3Url): self { $this->options['awsS3Url'] = $awsS3Url; return $this; } /** * Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * @return $this Fluent Builder */ public function setAwsStorageEnabled(bool $awsStorageEnabled): self { $this->options['awsStorageEnabled'] = $awsStorageEnabled; return $this; } /** * Whether all recordings should be stored in an encrypted form. The default is `false`. * * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. * @return $this Fluent Builder */ public function setEncryptionEnabled(bool $encryptionEnabled): self { $this->options['encryptionEnabled'] = $encryptionEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateRecordingSettingsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/RoomPage.php000064400000002764150364341760014100 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookInstance.php000064400000013101150364341760017163 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'enabled' => Values::array_get($payload, 'enabled'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'audioSources' => Values::array_get($payload, 'audio_sources'), 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), 'videoLayout' => Values::array_get($payload, 'video_layout'), 'resolution' => Values::array_get($payload, 'resolution'), 'trim' => Values::array_get($payload, 'trim'), 'format' => Values::array_get($payload, 'format'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CompositionHookContext Context for this CompositionHookInstance */ protected function proxy(): CompositionHookContext { if (!$this->context) { $this->context = new CompositionHookContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CompositionHookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CompositionHookInstance * * @return CompositionHookInstance Fetched CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionHookInstance { return $this->proxy()->fetch(); } /** * Update the CompositionHookInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName, array $options = []): CompositionHookInstance { return $this->proxy()->update($friendlyName, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionHookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsPage.php000064400000003102150364341760016604 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionPage.php000064400000003036150364341760015460 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingInstance.php000064400000012137150364341760015763 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'sid' => Values::array_get($payload, 'sid'), 'sourceSid' => Values::array_get($payload, 'source_sid'), 'size' => Values::array_get($payload, 'size'), 'url' => Values::array_get($payload, 'url'), 'type' => Values::array_get($payload, 'type'), 'duration' => Values::array_get($payload, 'duration'), 'containerFormat' => Values::array_get($payload, 'container_format'), 'codec' => Values::array_get($payload, 'codec'), 'groupingSids' => Values::array_get($payload, 'grouping_sids'), 'trackName' => Values::array_get($payload, 'track_name'), 'offset' => Values::array_get($payload, 'offset'), 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.php000064400000015176150364341760017770 0ustar00RFC 3986. * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. * @return CreateCompositionSettingsOptions Options builder */ public static function create( string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::BOOL_NONE, bool $encryptionEnabled = Values::BOOL_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. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. */ public function __construct( string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::BOOL_NONE, bool $encryptionEnabled = Values::BOOL_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 RFC 3986. * * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. * @return $this Fluent Builder */ public function setAwsS3Url(string $awsS3Url): self { $this->options['awsS3Url'] = $awsS3Url; return $this; } /** * Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * @return $this Fluent Builder */ public function setAwsStorageEnabled(bool $awsStorageEnabled): self { $this->options['awsStorageEnabled'] = $awsStorageEnabled; return $this; } /** * Whether all compositions should be stored in an encrypted form. The default is `false`. * * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. * @return $this Fluent Builder */ public function setEncryptionEnabled(bool $encryptionEnabled): self { $this->options['encryptionEnabled'] = $encryptionEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateCompositionSettingsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingContext.php000064400000004351150364341760015642 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Recordings/' . \rawurlencode($sid) .''; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingOptions.php000064400000015302150364341760015647 0ustar00options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['groupingSid'] = $groupingSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['mediaType'] = $mediaType; } /** * Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. * * @param string $status Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only the recordings that have this `source_sid`. * * @param string $sourceSid Read only the recordings that have this `source_sid`. * @return $this Fluent Builder */ public function setSourceSid(string $sourceSid): self { $this->options['sourceSid'] = $sourceSid; return $this; } /** * Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. * * @param string[] $groupingSid Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. * @return $this Fluent Builder */ public function setGroupingSid(array $groupingSid): self { $this->options['groupingSid'] = $groupingSid; return $this; } /** * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. * * @param \DateTime $dateCreatedBefore Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only recordings that have this media type. Can be either `audio` or `video`. * * @param string $mediaType Read only recordings that have this media type. Can be either `audio` or `video`. * @return $this Fluent Builder */ public function setMediaType(string $mediaType): self { $this->options['mediaType'] = $mediaType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsList.php000064400000002612150364341760017237 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Video/V1/RoomInstance.php000064400000015247150364341760014770 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'accountSid' => Values::array_get($payload, 'account_sid'), 'enableTurn' => Values::array_get($payload, 'enable_turn'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'type' => Values::array_get($payload, 'type'), 'maxParticipants' => Values::array_get($payload, 'max_participants'), 'maxParticipantDuration' => Values::array_get($payload, 'max_participant_duration'), 'maxConcurrentPublishedTracks' => Values::array_get($payload, 'max_concurrent_published_tracks'), 'recordParticipantsOnConnect' => Values::array_get($payload, 'record_participants_on_connect'), 'videoCodecs' => Values::array_get($payload, 'video_codecs'), 'mediaRegion' => Values::array_get($payload, 'media_region'), 'audioOnly' => Values::array_get($payload, 'audio_only'), 'emptyRoomTimeout' => Values::array_get($payload, 'empty_room_timeout'), 'unusedRoomTimeout' => Values::array_get($payload, 'unused_room_timeout'), 'largeRoom' => Values::array_get($payload, 'large_room'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoomContext Context for this RoomInstance */ protected function proxy(): RoomContext { if (!$this->context) { $this->context = new RoomContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the RoomInstance * * @return RoomInstance Fetched RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoomInstance { return $this->proxy()->fetch(); } /** * Update the RoomInstance * * @param string $status * @return RoomInstance Updated RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): RoomInstance { return $this->proxy()->update($status); } /** * Access the recordingRules */ protected function getRecordingRules(): RecordingRulesList { return $this->proxy()->recordingRules; } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the recordings */ protected function getRecordings(): RoomRecordingList { return $this->proxy()->recordings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingPage.php000064400000003022150364341760015064 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionOptions.php000064400000047752150364341760016254 0ustar00options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['trim'] = $trim; } /** * An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * * @param array $videoLayout An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * @return $this Fluent Builder */ public function setVideoLayout(array $videoLayout): self { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * * @param string[] $audioSources An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * @return $this Fluent Builder */ public function setAudioSources(array $audioSources): self { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string[] $audioSourcesExcluded An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @return $this Fluent Builder */ public function setAudioSourcesExcluded(array $audioSourcesExcluded): self { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setResolution(string $resolution): self { $this->options['resolution'] = $resolution; return $this; } /** * @param string $format * @return $this Fluent Builder */ public function setFormat(string $format): self { $this->options['format'] = $format; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setTrim(bool $trim): self { $this->options['trim'] = $trim; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateCompositionOptions ' . $options . ']'; } } class ReadCompositionOptions extends Options { /** * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. * @param string $roomSid Read only Composition resources with this Room SID. */ public function __construct( string $status = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $roomSid = Values::NONE ) { $this->options['status'] = $status; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['roomSid'] = $roomSid; } /** * Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. * * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Composition resources created before this ISO 8601 date-time with time zone. * * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only Composition resources with this Room SID. * * @param string $roomSid Read only Composition resources with this Room SID. * @return $this Fluent Builder */ public function setRoomSid(string $roomSid): self { $this->options['roomSid'] = $roomSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadCompositionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsPage.php000064400000003116150364341760017200 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsInstance.php000064400000010575150364341760020077 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CompositionSettingsContext Context for this CompositionSettingsInstance */ protected function proxy(): CompositionSettingsContext { if (!$this->context) { $this->context = new CompositionSettingsContext( $this->version ); } return $this->context; } /** * Create the CompositionSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe the resource and show to the user in the console * @param array|Options $options Optional Arguments * @return CompositionSettingsInstance Created CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): CompositionSettingsInstance { return $this->proxy()->create($friendlyName, $options); } /** * Fetch the CompositionSettingsInstance * * @return CompositionSettingsInstance Fetched CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionSettingsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionSettingsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php000064400000006217150364341760017366 0ustar00solution = [ ]; $this->uri = '/RecordingSettings/Default'; } /** * Create the RecordingSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe the resource and be shown to users in the console * @param array|Options $options Optional Arguments * @return RecordingSettingsInstance Created RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): RecordingSettingsInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'AwsCredentialsSid' => $options['awsCredentialsSid'], 'EncryptionKeySid' => $options['encryptionKeySid'], 'AwsS3Url' => $options['awsS3Url'], 'AwsStorageEnabled' => Serialize::booleanToString($options['awsStorageEnabled']), 'EncryptionEnabled' => Serialize::booleanToString($options['encryptionEnabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RecordingSettingsInstance( $this->version, $payload ); } /** * 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 ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesInstance.php000064400000005023150364341760017706 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php000064400000005005150364341760017410 0ustar00solution = [ 'roomSid' => $roomSid, 'sid' => $sid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Recordings/' . \rawurlencode($sid) .''; } /** * Delete the RoomRecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php000064400000005233150364341760017060 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php000064400000014734150364341760017126 0ustar00solution = [ '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 subscribeRules */ protected function getSubscribeRules(): SubscribeRulesList { if (!$this->_subscribeRules) { $this->_subscribeRules = new SubscribeRulesList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_subscribeRules; } /** * Access the subscribedTracks */ protected function getSubscribedTracks(): SubscribedTrackList { if (!$this->_subscribedTracks) { $this->_subscribedTracks = new SubscribedTrackList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_subscribedTracks; } /** * Access the publishedTracks */ protected function getPublishedTracks(): PublishedTrackList { if (!$this->_publishedTracks) { $this->_publishedTracks = new PublishedTrackList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_publishedTracks; } /** * Access the anonymize */ protected function getAnonymize(): AnonymizeList { if (!$this->_anonymize) { $this->_anonymize = new AnonymizeList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_anonymize; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php000064400000003221150364341760021247 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizePage.php000064400000003150150364341760020315 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php000064400000005076150364341760022031 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php000064400000013450150364341760021313 0ustar00solution = [ 'roomSid' => $roomSid, 'participantSid' => $participantSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($participantSid) .'/PublishedTracks'; } /** * Reads PublishedTrackInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PublishedTrackInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PublishedTrackInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PublishedTrackInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PublishedTrackPage Page of PublishedTrackInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PublishedTrackPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PublishedTrackPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PublishedTrackInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PublishedTrackPage Page of PublishedTrackInstance */ public function getPage(string $targetUrl): PublishedTrackPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PublishedTrackPage($this->version, $response, $this->solution); } /** * Constructs a PublishedTrackContext * * @param string $sid The SID of the RoomParticipantPublishedTrack resource to fetch. */ public function getContext( string $sid ): PublishedTrackContext { return new PublishedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.PublishedTrackList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php000064400000004653150364341760022070 0ustar00options['rules'] = $rules; } /** * A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. * * @param array $rules A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. * @return $this Fluent Builder */ public function setRules(array $rules): self { $this->options['rules'] = $rules; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.UpdateSubscribeRulesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php000064400000011002150364341760022301 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php000064400000005501150364341760022172 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php000064400000006016150364341760021343 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php000064400000004323150364341760021070 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php000064400000013471150364341760021464 0ustar00solution = [ 'roomSid' => $roomSid, 'participantSid' => $participantSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($participantSid) .'/SubscribedTracks'; } /** * Reads SubscribedTrackInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SubscribedTrackInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SubscribedTrackInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SubscribedTrackInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SubscribedTrackPage Page of SubscribedTrackInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SubscribedTrackPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SubscribedTrackPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SubscribedTrackInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SubscribedTrackPage Page of SubscribedTrackInstance */ public function getPage(string $targetUrl): SubscribedTrackPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SubscribedTrackPage($this->version, $response, $this->solution); } /** * Constructs a SubscribedTrackContext * * @param string $sid The SID of the RoomParticipantSubscribedTrack resource to fetch. */ public function getContext( string $sid ): SubscribedTrackContext { return new SubscribedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.SubscribedTrackList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeList.php000064400000003330150364341760020354 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeInstance.php000064400000010470150364341760021210 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php000064400000003227150364341760021423 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php000064400000010607150364341760022145 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php000064400000005104150364341760022167 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php000064400000003221150364341760021277 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php000064400000012250150364341760017530 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'sid' => Values::array_get($payload, 'sid'), 'sourceSid' => Values::array_get($payload, 'source_sid'), 'size' => Values::array_get($payload, 'size'), 'url' => Values::array_get($payload, 'url'), 'type' => Values::array_get($payload, 'type'), 'duration' => Values::array_get($payload, 'duration'), 'containerFormat' => Values::array_get($payload, 'container_format'), 'codec' => Values::array_get($payload, 'codec'), 'groupingSids' => Values::array_get($payload, 'grouping_sids'), 'trackName' => Values::array_get($payload, 'track_name'), 'offset' => Values::array_get($payload, 'offset'), 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['roomSid' => $roomSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoomRecordingContext Context for this RoomRecordingInstance */ protected function proxy(): RoomRecordingContext { if (!$this->context) { $this->context = new RoomRecordingContext( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoomRecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoomRecordingInstance * * @return RoomRecordingInstance Fetched RoomRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoomRecordingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomRecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingList.php000064400000014045150364341760016703 0ustar00solution = [ 'roomSid' => $roomSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Recordings'; } /** * Reads RoomRecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoomRecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RoomRecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoomRecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RoomRecordingPage Page of RoomRecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RoomRecordingPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'SourceSid' => $options['sourceSid'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RoomRecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoomRecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RoomRecordingPage Page of RoomRecordingInstance */ public function getPage(string $targetUrl): RoomRecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RoomRecordingPage($this->version, $response, $this->solution); } /** * Constructs a RoomRecordingContext * * @param string $sid The SID of the RoomRecording resource to delete. */ public function getContext( string $sid ): RoomRecordingContext { return new RoomRecordingContext( $this->version, $this->solution['roomSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RoomRecordingList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantInstance.php000064400000013544150364341760017244 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['roomSid' => $roomSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ParticipantContext Context for this ParticipantInstance */ protected function proxy(): ParticipantContext { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { return $this->proxy()->update($options); } /** * Access the subscribeRules */ protected function getSubscribeRules(): SubscribeRulesList { return $this->proxy()->subscribeRules; } /** * Access the subscribedTracks */ protected function getSubscribedTracks(): SubscribedTrackList { return $this->proxy()->subscribedTracks; } /** * Access the publishedTracks */ protected function getPublishedTracks(): PublishedTrackList { return $this->proxy()->publishedTracks; } /** * Access the anonymize */ protected function getAnonymize(): AnonymizeList { return $this->proxy()->anonymize; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantPage.php000064400000003104150364341760016343 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantOptions.php000064400000014712150364341760017131 0ustar00options['status'] = $status; $this->options['identity'] = $identity; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * * @param string $status Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. * * @param string $identity Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * * @param \DateTime $dateCreatedAfter Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * * @param \DateTime $dateCreatedBefore Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadParticipantOptions ' . $options . ']'; } } class UpdateParticipantOptions extends Options { /** * @param string $status */ public function __construct( string $status = Values::NONE ) { $this->options['status'] = $status; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.UpdateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php000064400000003120150364341760016634 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesOptions.php000064400000003543150364341760017602 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesPage.php000064400000003126150364341760017020 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php000064400000011406150364341760017421 0ustar00options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. * * @param string $status Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only the recordings that have this `source_sid`. * * @param string $sourceSid Read only the recordings that have this `source_sid`. * @return $this Fluent Builder */ public function setSourceSid(string $sourceSid): self { $this->options['sourceSid'] = $sourceSid; return $this; } /** * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedBefore Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadRoomRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantList.php000064400000013775150364341760016421 0ustar00solution = [ 'roomSid' => $roomSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants'; } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'Identity' => $options['identity'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid The SID of the RoomParticipant resource to fetch. */ public function getContext( string $sid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['roomSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Video/V1/RoomOptions.php000064400000053237150364341760014660 0ustar00options['enableTurn'] = $enableTurn; $this->options['type'] = $type; $this->options['uniqueName'] = $uniqueName; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['maxParticipants'] = $maxParticipants; $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; $this->options['videoCodecs'] = $videoCodecs; $this->options['mediaRegion'] = $mediaRegion; $this->options['recordingRules'] = $recordingRules; $this->options['audioOnly'] = $audioOnly; $this->options['maxParticipantDuration'] = $maxParticipantDuration; $this->options['emptyRoomTimeout'] = $emptyRoomTimeout; $this->options['unusedRoomTimeout'] = $unusedRoomTimeout; $this->options['largeRoom'] = $largeRoom; } /** * Deprecated, now always considered to be true. * * @param bool $enableTurn Deprecated, now always considered to be true. * @return $this Fluent Builder */ public function setEnableTurn(bool $enableTurn): self { $this->options['enableTurn'] = $enableTurn; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. * * @param int $maxParticipants The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. * @return $this Fluent Builder */ public function setMaxParticipants(int $maxParticipants): self { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** * * @param bool $recordParticipantsOnConnect Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** * @return $this Fluent Builder */ public function setRecordParticipantsOnConnect(bool $recordParticipantsOnConnect): self { $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; return $this; } /** * An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** * * @param string $videoCodecs An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** * @return $this Fluent Builder */ public function setVideoCodecs(array $videoCodecs): self { $this->options['videoCodecs'] = $videoCodecs; return $this; } /** * The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** * * @param string $mediaRegion The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** * @return $this Fluent Builder */ public function setMediaRegion(string $mediaRegion): self { $this->options['mediaRegion'] = $mediaRegion; return $this; } /** * A collection of Recording Rules that describe how to include or exclude matching tracks for recording * * @param array $recordingRules A collection of Recording Rules that describe how to include or exclude matching tracks for recording * @return $this Fluent Builder */ public function setRecordingRules(array $recordingRules): self { $this->options['recordingRules'] = $recordingRules; return $this; } /** * When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. * * @param bool $audioOnly When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. * @return $this Fluent Builder */ public function setAudioOnly(bool $audioOnly): self { $this->options['audioOnly'] = $audioOnly; return $this; } /** * The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). * * @param int $maxParticipantDuration The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). * @return $this Fluent Builder */ public function setMaxParticipantDuration(int $maxParticipantDuration): self { $this->options['maxParticipantDuration'] = $maxParticipantDuration; return $this; } /** * Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). * * @param int $emptyRoomTimeout Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). * @return $this Fluent Builder */ public function setEmptyRoomTimeout(int $emptyRoomTimeout): self { $this->options['emptyRoomTimeout'] = $emptyRoomTimeout; return $this; } /** * Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). * * @param int $unusedRoomTimeout Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). * @return $this Fluent Builder */ public function setUnusedRoomTimeout(int $unusedRoomTimeout): self { $this->options['unusedRoomTimeout'] = $unusedRoomTimeout; return $this; } /** * When set to true, indicated that this is the large room. * * @param bool $largeRoom When set to true, indicated that this is the large room. * @return $this Fluent Builder */ public function setLargeRoom(bool $largeRoom): self { $this->options['largeRoom'] = $largeRoom; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateRoomOptions ' . $options . ']'; } } class ReadRoomOptions extends Options { /** * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * @param string $uniqueName Read only rooms with the this `unique_name`. * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. */ public function __construct( string $status = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null ) { $this->options['status'] = $status; $this->options['uniqueName'] = $uniqueName; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only rooms with the this `unique_name`. * * @param string $uniqueName Read only rooms with the this `unique_name`. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Read only rooms that started on or after this date, given as `YYYY-MM-DD`. * * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only rooms that started before this date, given as `YYYY-MM-DD`. * * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadRoomOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookOptions.php000064400000113073150364341760017063 0ustar00options['enabled'] = $enabled; $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['trim'] = $trim; } /** * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. * * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param array $videoLayout An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setVideoLayout(array $videoLayout): self { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @return $this Fluent Builder */ public function setAudioSources(array $audioSources): self { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @return $this Fluent Builder */ public function setAudioSourcesExcluded(array $audioSourcesExcluded): self { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setResolution(string $resolution): self { $this->options['resolution'] = $resolution; return $this; } /** * @param string $format * @return $this Fluent Builder */ public function setFormat(string $format): self { $this->options['format'] = $format; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setTrim(bool $trim): self { $this->options['trim'] = $trim; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateCompositionHookOptions ' . $options . ']'; } } class ReadCompositionHookOptions extends Options { /** * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. */ public function __construct( bool $enabled = Values::BOOL_NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $friendlyName = Values::NONE ) { $this->options['enabled'] = $enabled; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['friendlyName'] = $friendlyName; } /** * Read only CompositionHook resources with an `enabled` value that matches this parameter. * * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. * * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadCompositionHookOptions ' . $options . ']'; } } class UpdateCompositionHookOptions extends Options { /** * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $format * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */ public function __construct( bool $enabled = Values::BOOL_NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, bool $trim = Values::BOOL_NONE, string $format = Values::NONE, string $resolution = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE ) { $this->options['enabled'] = $enabled; $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['trim'] = $trim; $this->options['format'] = $format; $this->options['resolution'] = $resolution; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. * * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setVideoLayout(array $videoLayout): self { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @return $this Fluent Builder */ public function setAudioSources(array $audioSources): self { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @return $this Fluent Builder */ public function setAudioSourcesExcluded(array $audioSourcesExcluded): self { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setTrim(bool $trim): self { $this->options['trim'] = $trim; return $this; } /** * @param string $format * @return $this Fluent Builder */ public function setFormat(string $format): self { $this->options['format'] = $format; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setResolution(string $resolution): self { $this->options['resolution'] = $resolution; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.UpdateCompositionHookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingList.php000064400000013607150364341760015135 0ustar00solution = [ ]; $this->uri = '/Recordings'; } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordingPage Page of RecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordingPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'SourceSid' => $options['sourceSid'], 'GroupingSid' => Serialize::map($options['groupingSid'], function ($e) { return $e; }), 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'MediaType' => $options['mediaType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordingPage Page of RecordingInstance */ public function getPage(string $targetUrl): RecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The SID of the Recording resource to delete. */ public function getContext( string $sid ): RecordingContext { return new RecordingContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RecordingList]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookPage.php000064400000003066150364341760016304 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php000064400000006252150364341760017754 0ustar00solution = [ ]; $this->uri = '/CompositionSettings/Default'; } /** * Create the CompositionSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe the resource and show to the user in the console * @param array|Options $options Optional Arguments * @return CompositionSettingsInstance Created CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): CompositionSettingsInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'AwsCredentialsSid' => $options['awsCredentialsSid'], 'EncryptionKeySid' => $options['encryptionKeySid'], 'AwsS3Url' => $options['awsS3Url'], 'AwsStorageEnabled' => Serialize::booleanToString($options['awsStorageEnabled']), 'EncryptionEnabled' => Serialize::booleanToString($options['encryptionEnabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CompositionSettingsInstance( $this->version, $payload ); } /** * 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 ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionInstance.php000064400000013041150364341760016345 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'dateDeleted' => Deserialize::dateTime(Values::array_get($payload, 'date_deleted')), 'sid' => Values::array_get($payload, 'sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'audioSources' => Values::array_get($payload, 'audio_sources'), 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), 'videoLayout' => Values::array_get($payload, 'video_layout'), 'resolution' => Values::array_get($payload, 'resolution'), 'trim' => Values::array_get($payload, 'trim'), 'format' => Values::array_get($payload, 'format'), 'bitrate' => Values::array_get($payload, 'bitrate'), 'size' => Values::array_get($payload, 'size'), 'duration' => Values::array_get($payload, 'duration'), 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CompositionContext Context for this CompositionInstance */ protected function proxy(): CompositionContext { if (!$this->context) { $this->context = new CompositionContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CompositionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CompositionInstance * * @return CompositionInstance Fetched CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RoomContext.php000064400000012221150364341760014635 0ustar00solution = [ '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 * @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 recordingRules */ protected function getRecordingRules(): RecordingRulesList { if (!$this->_recordingRules) { $this->_recordingRules = new RecordingRulesList( $this->version, $this->solution['sid'] ); } return $this->_recordingRules; } /** * Access the participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['sid'] ); } return $this->_participants; } /** * Access the recordings */ protected function getRecordings(): RoomRecordingList { if (!$this->_recordings) { $this->_recordings = new RoomRecordingList( $this->version, $this->solution['sid'] ); } return $this->_recordings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionList.php000064400000016351150364341760015523 0ustar00solution = [ ]; $this->uri = '/Compositions'; } /** * Create the CompositionInstance * * @param string $roomSid The SID of the Group Room with the media tracks to be used as composition sources. * @param array|Options $options Optional Arguments * @return CompositionInstance Created CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $roomSid, array $options = []): CompositionInstance { $options = new Values($options); $data = Values::of([ 'RoomSid' => $roomSid, 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function ($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), 'Resolution' => $options['resolution'], 'Format' => $options['format'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Trim' => Serialize::booleanToString($options['trim']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CompositionInstance( $this->version, $payload ); } /** * Reads CompositionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CompositionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CompositionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CompositionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CompositionPage Page of CompositionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CompositionPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'RoomSid' => $options['roomSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CompositionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CompositionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CompositionPage Page of CompositionInstance */ public function getPage(string $targetUrl): CompositionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CompositionPage($this->version, $response, $this->solution); } /** * Constructs a CompositionContext * * @param string $sid The SID of the Composition resource to delete. */ public function getContext( string $sid ): CompositionContext { return new CompositionContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.CompositionList]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookList.php000064400000017042150364341760016342 0ustar00solution = [ ]; $this->uri = '/CompositionHooks'; } /** * Create the CompositionHookInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. * @param array|Options $options Optional Arguments * @return CompositionHookInstance Created CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): CompositionHookInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Enabled' => Serialize::booleanToString($options['enabled']), 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function ($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), 'Resolution' => $options['resolution'], 'Format' => $options['format'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Trim' => Serialize::booleanToString($options['trim']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CompositionHookInstance( $this->version, $payload ); } /** * Reads CompositionHookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CompositionHookInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CompositionHookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CompositionHookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CompositionHookPage Page of CompositionHookInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CompositionHookPage { $options = new Values($options); $params = Values::of([ 'Enabled' => Serialize::booleanToString($options['enabled']), 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CompositionHookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CompositionHookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CompositionHookPage Page of CompositionHookInstance */ public function getPage(string $targetUrl): CompositionHookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CompositionHookPage($this->version, $response, $this->solution); } /** * Constructs a CompositionHookContext * * @param string $sid The SID of the CompositionHook resource to delete. */ public function getContext( string $sid ): CompositionHookContext { return new CompositionHookContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.CompositionHookList]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookContext.php000064400000010024150364341760017044 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/CompositionHooks/' . \rawurlencode($sid) .''; } /** * Delete the CompositionHookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the CompositionHookInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName, array $options = []): CompositionHookInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Enabled' => Serialize::booleanToString($options['enabled']), 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function ($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), 'Trim' => Serialize::booleanToString($options['trim']), 'Format' => $options['format'], 'Resolution' => $options['resolution'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], ]); $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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionContext.php000064400000004377150364341760016241 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Compositions/' . \rawurlencode($sid) .''; } /** * Delete the CompositionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RoomList.php000064400000016653150364341760014141 0ustar00solution = [ ]; $this->uri = '/Rooms'; } /** * Create the RoomInstance * * @param array|Options $options Optional Arguments * @return RoomInstance Created RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): RoomInstance { $options = new Values($options); $data = Values::of([ 'EnableTurn' => Serialize::booleanToString($options['enableTurn']), 'Type' => $options['type'], 'UniqueName' => $options['uniqueName'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'MaxParticipants' => $options['maxParticipants'], 'RecordParticipantsOnConnect' => Serialize::booleanToString($options['recordParticipantsOnConnect']), 'VideoCodecs' => $options['videoCodecs'], 'MediaRegion' => $options['mediaRegion'], 'RecordingRules' => Serialize::jsonObject($options['recordingRules']), 'AudioOnly' => Serialize::booleanToString($options['audioOnly']), 'MaxParticipantDuration' => $options['maxParticipantDuration'], 'EmptyRoomTimeout' => $options['emptyRoomTimeout'], 'UnusedRoomTimeout' => $options['unusedRoomTimeout'], 'LargeRoom' => Serialize::booleanToString($options['largeRoom']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoomInstance( $this->version, $payload ); } /** * Reads RoomInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoomInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RoomInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoomInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RoomPage Page of RoomInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RoomPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'UniqueName' => $options['uniqueName'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RoomPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoomInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RoomPage Page of RoomInstance */ public function getPage(string $targetUrl): RoomPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RoomPage($this->version, $response, $this->solution); } /** * Constructs a RoomContext * * @param string $sid The SID of the Room resource to fetch. */ public function getContext( string $sid ): RoomContext { return new RoomContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RoomList]'; } } sdk/src/Twilio/Rest/TaskrouterBase.php000064400000004556150364341760013772 0ustar00baseUrl = 'https://taskrouter.twilio.com'; } /** * @return V1 Version v1 of taskrouter */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter]'; } } sdk/src/Twilio/Rest/MediaBase.php000064400000004513150364341760012637 0ustar00baseUrl = '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); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Media]'; } } sdk/src/Twilio/Rest/Taskrouter.php000064400000001333150364341760013165 0ustar00workspaces instead. */ protected function getWorkspaces(): \Twilio\Rest\Taskrouter\V1\WorkspaceList { echo "workspaces is deprecated. Use v1->workspaces instead."; return $this->v1->workspaces; } /** * @deprecated Use v1->workspaces(\$sid) instead. * @param string $sid The SID of the resource to fetch */ protected function contextWorkspaces(string $sid): \Twilio\Rest\Taskrouter\V1\WorkspaceContext { echo "workspaces(\$sid) is deprecated. Use v1->workspaces(\$sid) instead."; return $this->v1->workspaces($sid); } }sdk/src/Twilio/Rest/Supersim.php000064400000012003150364341760012625 0ustar00esimProfiles instead. */ protected function getEsimProfiles(): \Twilio\Rest\Supersim\V1\EsimProfileList { echo "esimProfiles is deprecated. Use v1->esimProfiles instead."; return $this->v1->esimProfiles; } /** * @deprecated Use v1->esimProfiles(\$sid) instead. * @param string $sid The SID of the eSIM Profile resource to fetch */ protected function contextEsimProfiles(string $sid): \Twilio\Rest\Supersim\V1\EsimProfileContext { echo "esimProfiles(\$sid) is deprecated. Use v1->esimProfiles(\$sid) instead."; return $this->v1->esimProfiles($sid); } /** * @deprecated Use v1->fleets instead. */ protected function getFleets(): \Twilio\Rest\Supersim\V1\FleetList { echo "fleets is deprecated. Use v1->fleets instead."; return $this->v1->fleets; } /** * @deprecated Use v1->fleets(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextFleets(string $sid): \Twilio\Rest\Supersim\V1\FleetContext { echo "fleets(\$sid) is deprecated. Use v1->fleets(\$sid) instead."; return $this->v1->fleets($sid); } /** * @deprecated Use v1->ipCommands instead. */ protected function getIpCommands(): \Twilio\Rest\Supersim\V1\IpCommandList { echo "ipCommands is deprecated. Use v1->ipCommands instead."; return $this->v1->ipCommands; } /** * @deprecated Use v1->ipCommands(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextIpCommands(string $sid): \Twilio\Rest\Supersim\V1\IpCommandContext { echo "ipCommands(\$sid) is deprecated. Use v1->ipCommands(\$sid) instead."; return $this->v1->ipCommands($sid); } /** * @deprecated Use v1->networks instead. */ protected function getNetworks(): \Twilio\Rest\Supersim\V1\NetworkList { echo "networks is deprecated. Use v1->networks instead."; return $this->v1->networks; } /** * @deprecated Use v1->networks(\$sid) instead. * @param string $sid The SID of the Network resource to fetch */ protected function contextNetworks(string $sid): \Twilio\Rest\Supersim\V1\NetworkContext { echo "networks(\$sid) is deprecated. Use v1->networks(\$sid) instead."; return $this->v1->networks($sid); } /** * @deprecated Use v1->networkAccessProfiles instead. */ protected function getNetworkAccessProfiles(): \Twilio\Rest\Supersim\V1\NetworkAccessProfileList { echo "networkAccessProfiles is deprecated. Use v1->networkAccessProfiles instead."; return $this->v1->networkAccessProfiles; } /** * @deprecated Use v1->networkAccessProfiles(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextNetworkAccessProfiles(string $sid): \Twilio\Rest\Supersim\V1\NetworkAccessProfileContext { echo "networkAccessProfiles(\$sid) is deprecated. Use v1->networkAccessProfiles(\$sid) instead."; return $this->v1->networkAccessProfiles($sid); } /** * @deprecated Use v1->settingsUpdates instead. */ protected function getSettingsUpdates(): \Twilio\Rest\Supersim\V1\SettingsUpdateList { echo "settingsUpdates is deprecated. Use v1->settingsUpdates instead."; return $this->v1->settingsUpdates; } /** * @deprecated Use v1->sims instead. */ protected function getSims(): \Twilio\Rest\Supersim\V1\SimList { echo "sims is deprecated. Use v1->sims instead."; return $this->v1->sims; } /** * @deprecated Use v1->sims(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextSims(string $sid): \Twilio\Rest\Supersim\V1\SimContext { echo "sims(\$sid) is deprecated. Use v1->sims(\$sid) instead."; return $this->v1->sims($sid); } /** * @deprecated Use v1->smsCommands instead. */ protected function getSmsCommands(): \Twilio\Rest\Supersim\V1\SmsCommandList { echo "smsCommands is deprecated. Use v1->smsCommands instead."; return $this->v1->smsCommands; } /** * @deprecated Use v1->smsCommands(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextSmsCommands(string $sid): \Twilio\Rest\Supersim\V1\SmsCommandContext { echo "smsCommands(\$sid) is deprecated. Use v1->smsCommands(\$sid) instead."; return $this->v1->smsCommands($sid); } /** * @deprecated Use v1->usageRecords instead. */ protected function getUsageRecords(): \Twilio\Rest\Supersim\V1\UsageRecordList { echo "usageRecords is deprecated. Use v1->usageRecords instead."; return $this->v1->usageRecords; } }sdk/src/Twilio/Rest/NotifyBase.php000064400000004522150364341760013070 0ustar00baseUrl = 'https://notify.twilio.com'; } /** * @return V1 Version v1 of notify */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Notify]'; } } sdk/src/Twilio/Rest/WirelessBase.php000064400000004540150364341760013415 0ustar00baseUrl = 'https://wireless.twilio.com'; } /** * @return V1 Version v1 of wireless */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless]'; } } sdk/src/Twilio/Rest/Trunking.php000064400000001257150364341760012630 0ustar00trunks instead. */ protected function getTrunks(): \Twilio\Rest\Trunking\V1\TrunkList { echo "trunks is deprecated. Use v1->trunks instead."; return $this->v1->trunks; } /** * @deprecated Use v1->trunks(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextTrunks(string $sid): \Twilio\Rest\Trunking\V1\TrunkContext { echo "trunks(\$sid) is deprecated. Use v1->trunks(\$sid) instead."; return $this->v1->trunks($sid); } }sdk/src/Twilio/Rest/OauthBase.php000064400000004513150364341760012700 0ustar00baseUrl = 'https://oauth.twilio.com'; } /** * @return V1 Version v1 of oauth */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth]'; } } sdk/src/Twilio/Rest/Microvisor/V1.php000064400000007400150364341760013445 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Microvisor/V1/DeviceContext.php000064400000012263150364341760016214 0ustar00solution = [ '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']), 'RestartApp' => Serialize::booleanToString($options['restartApp']), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/DeviceOptions.php000064400000010776150364341760016232 0ustar00options['uniqueName'] = $uniqueName; $this->options['targetApp'] = $targetApp; $this->options['loggingEnabled'] = $loggingEnabled; $this->options['restartApp'] = $restartApp; } /** * A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. * * @param string $uniqueName A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The SID or unique name of the App to be targeted to the Device. * * @param string $targetApp The SID or unique name of the App to be targeted to the Device. * @return $this Fluent Builder */ public function setTargetApp(string $targetApp): self { $this->options['targetApp'] = $targetApp; return $this; } /** * A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. * * @param bool $loggingEnabled A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. * @return $this Fluent Builder */ public function setLoggingEnabled(bool $loggingEnabled): self { $this->options['loggingEnabled'] = $loggingEnabled; return $this; } /** * Set to true to restart the App running on the Device. * * @param bool $restartApp Set to true to restart the App running on the Device. * @return $this Fluent Builder */ public function setRestartApp(bool $restartApp): self { $this->options['restartApp'] = $restartApp; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Microvisor.V1.UpdateDeviceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/DevicePage.php000064400000003024150364341760015437 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretList.php000064400000013646150364341760017054 0ustar00solution = [ ]; $this->uri = '/Secrets'; } /** * Create the AccountSecretInstance * * @param string $key The secret key; up to 100 characters. * @param string $value The secret value; up to 4096 characters. * @return AccountSecretInstance Created AccountSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, string $value): AccountSecretInstance { $data = Values::of([ 'Key' => $key, 'Value' => $value, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AccountSecretInstance( $this->version, $payload ); } /** * Reads AccountSecretInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AccountSecretInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AccountSecretInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AccountSecretInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AccountSecretPage Page of AccountSecretInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AccountSecretPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AccountSecretPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AccountSecretInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AccountSecretPage Page of AccountSecretInstance */ public function getPage(string $targetUrl): AccountSecretPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AccountSecretPage($this->version, $response, $this->solution); } /** * Constructs a AccountSecretContext * * @param string $key The secret key; up to 100 characters. */ public function getContext( string $key ): AccountSecretContext { return new AccountSecretContext( $this->version, $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor.V1.AccountSecretList]'; } } sdk/src/Twilio/Rest/Microvisor/V1/DeviceInstance.php000064400000011374150364341760016336 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigPage.php000064400000003076150364341760016771 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigInstance.php000064400000010072150364341760017653 0ustar00properties = [ 'key' => Values::array_get($payload, 'key'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'value' => Values::array_get($payload, 'value'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['key' => $key ?: $this->properties['key'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AccountConfigContext Context for this AccountConfigInstance */ protected function proxy(): AccountConfigContext { if (!$this->context) { $this->context = new AccountConfigContext( $this->version, $this->solution['key'] ); } return $this->context; } /** * Delete the AccountConfigInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AccountConfigInstance * * @return AccountConfigInstance Fetched AccountConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccountConfigInstance { return $this->proxy()->fetch(); } /** * Update the AccountConfigInstance * * @param string $value The config value; up to 4096 characters. * @return AccountConfigInstance Updated AccountConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): AccountConfigInstance { return $this->proxy()->update($value); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.AccountConfigInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretContext.php000064400000005644150364341760017564 0ustar00solution = [ 'key' => $key, ]; $this->uri = '/Secrets/' . \rawurlencode($key) .''; } /** * Delete the AccountSecretInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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; up to 4096 characters. * @return AccountSecretInstance Updated AccountSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): AccountSecretInstance { $data = Values::of([ 'Value' => $value, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AccountSecretInstance( $this->version, $payload, $this->solution['key'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.AccountSecretContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/AppPage.php000064400000003002150364341760014754 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretPage.php000064400000003076150364341760017011 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Microvisor/V1/DeviceList.php000064400000012075150364341760015504 0ustar00solution = [ ]; $this->uri = '/Devices'; } /** * Reads DeviceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeviceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeviceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeviceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DevicePage Page of DeviceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DevicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DevicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeviceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DevicePage Page of DeviceInstance */ public function getPage(string $targetUrl): DevicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DevicePage($this->version, $response, $this->solution); } /** * Constructs a DeviceContext * * @param string $sid A 34-character string that uniquely identifies this Device. */ public function getContext( string $sid ): DeviceContext { return new DeviceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor.V1.DeviceList]'; } } sdk/src/Twilio/Rest/Microvisor/V1/AccountSecretInstance.php000064400000007735150364341760017707 0ustar00properties = [ 'key' => Values::array_get($payload, 'key'), 'dateRotated' => Deserialize::dateTime(Values::array_get($payload, 'date_rotated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['key' => $key ?: $this->properties['key'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AccountSecretContext Context for this AccountSecretInstance */ protected function proxy(): AccountSecretContext { if (!$this->context) { $this->context = new AccountSecretContext( $this->version, $this->solution['key'] ); } return $this->context; } /** * Delete the AccountSecretInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AccountSecretInstance * * @return AccountSecretInstance Fetched AccountSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccountSecretInstance { return $this->proxy()->fetch(); } /** * Update the AccountSecretInstance * * @param string $value The secret value; up to 4096 characters. * @return AccountSecretInstance Updated AccountSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): AccountSecretInstance { return $this->proxy()->update($value); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.AccountSecretInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php000064400000006300150364341760020534 0ustar00solution = [ 'deviceSid' => $deviceSid, 'key' => $key, ]; $this->uri = '/Devices/' . \rawurlencode($deviceSid) .'/Configs/' . \rawurlencode($key) .''; } /** * Delete the DeviceConfigInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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; up to 4096 characters. * @return DeviceConfigInstance Updated DeviceConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): DeviceConfigInstance { $data = Values::of([ 'Value' => $value, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DeviceConfigInstance( $this->version, $payload, $this->solution['deviceSid'], $this->solution['key'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.DeviceConfigContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php000064400000006300150364341760020554 0ustar00solution = [ 'deviceSid' => $deviceSid, 'key' => $key, ]; $this->uri = '/Devices/' . \rawurlencode($deviceSid) .'/Secrets/' . \rawurlencode($key) .''; } /** * Delete the DeviceSecretInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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; up to 4096 characters. * @return DeviceSecretInstance Updated DeviceSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): DeviceSecretInstance { $data = Values::of([ 'Value' => $value, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DeviceSecretInstance( $this->version, $payload, $this->solution['deviceSid'], $this->solution['key'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.DeviceSecretContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigPage.php000064400000003144150364341760017767 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretInstance.php000064400000010365150364341760020702 0ustar00properties = [ 'deviceSid' => Values::array_get($payload, 'device_sid'), 'key' => Values::array_get($payload, 'key'), 'dateRotated' => Deserialize::dateTime(Values::array_get($payload, 'date_rotated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['deviceSid' => $deviceSid, 'key' => $key ?: $this->properties['key'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeviceSecretContext Context for this DeviceSecretInstance */ protected function proxy(): DeviceSecretContext { if (!$this->context) { $this->context = new DeviceSecretContext( $this->version, $this->solution['deviceSid'], $this->solution['key'] ); } return $this->context; } /** * Delete the DeviceSecretInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DeviceSecretInstance * * @return DeviceSecretInstance Fetched DeviceSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceSecretInstance { return $this->proxy()->fetch(); } /** * Update the DeviceSecretInstance * * @param string $value The secret value; up to 4096 characters. * @return DeviceSecretInstance Updated DeviceSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): DeviceSecretInstance { return $this->proxy()->update($value); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.DeviceSecretInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigList.php000064400000014310150364341760020023 0ustar00solution = [ 'deviceSid' => $deviceSid, ]; $this->uri = '/Devices/' . \rawurlencode($deviceSid) .'/Configs'; } /** * Create the DeviceConfigInstance * * @param string $key The config key; up to 100 characters. * @param string $value The config value; up to 4096 characters. * @return DeviceConfigInstance Created DeviceConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, string $value): DeviceConfigInstance { $data = Values::of([ 'Key' => $key, 'Value' => $value, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeviceConfigInstance( $this->version, $payload, $this->solution['deviceSid'] ); } /** * Reads DeviceConfigInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeviceConfigInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeviceConfigInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeviceConfigInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeviceConfigPage Page of DeviceConfigInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeviceConfigPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeviceConfigPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeviceConfigInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeviceConfigPage Page of DeviceConfigInstance */ public function getPage(string $targetUrl): DeviceConfigPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeviceConfigPage($this->version, $response, $this->solution); } /** * Constructs a DeviceConfigContext * * @param string $key The config key; up to 100 characters. */ public function getContext( string $key ): DeviceConfigContext { return new DeviceConfigContext( $this->version, $this->solution['deviceSid'], $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor.V1.DeviceConfigList]'; } } sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigInstance.php000064400000010522150364341760020655 0ustar00properties = [ 'deviceSid' => Values::array_get($payload, 'device_sid'), 'key' => Values::array_get($payload, 'key'), 'value' => Values::array_get($payload, 'value'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['deviceSid' => $deviceSid, 'key' => $key ?: $this->properties['key'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeviceConfigContext Context for this DeviceConfigInstance */ protected function proxy(): DeviceConfigContext { if (!$this->context) { $this->context = new DeviceConfigContext( $this->version, $this->solution['deviceSid'], $this->solution['key'] ); } return $this->context; } /** * Delete the DeviceConfigInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DeviceConfigInstance * * @return DeviceConfigInstance Fetched DeviceConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceConfigInstance { return $this->proxy()->fetch(); } /** * Update the DeviceConfigInstance * * @param string $value The config value; up to 4096 characters. * @return DeviceConfigInstance Updated DeviceConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): DeviceConfigInstance { return $this->proxy()->update($value); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.DeviceConfigInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretPage.php000064400000003144150364341760020007 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretList.php000064400000014310150364341760020043 0ustar00solution = [ 'deviceSid' => $deviceSid, ]; $this->uri = '/Devices/' . \rawurlencode($deviceSid) .'/Secrets'; } /** * Create the DeviceSecretInstance * * @param string $key The secret key; up to 100 characters. * @param string $value The secret value; up to 4096 characters. * @return DeviceSecretInstance Created DeviceSecretInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, string $value): DeviceSecretInstance { $data = Values::of([ 'Key' => $key, 'Value' => $value, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeviceSecretInstance( $this->version, $payload, $this->solution['deviceSid'] ); } /** * Reads DeviceSecretInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeviceSecretInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeviceSecretInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeviceSecretInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeviceSecretPage Page of DeviceSecretInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeviceSecretPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeviceSecretPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeviceSecretInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeviceSecretPage Page of DeviceSecretInstance */ public function getPage(string $targetUrl): DeviceSecretPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeviceSecretPage($this->version, $response, $this->solution); } /** * Constructs a DeviceSecretContext * * @param string $key The secret key; up to 100 characters. */ public function getContext( string $key ): DeviceSecretContext { return new DeviceSecretContext( $this->version, $this->solution['deviceSid'], $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor.V1.DeviceSecretList]'; } } sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigList.php000064400000013646150364341760017034 0ustar00solution = [ ]; $this->uri = '/Configs'; } /** * Create the AccountConfigInstance * * @param string $key The config key; up to 100 characters. * @param string $value The config value; up to 4096 characters. * @return AccountConfigInstance Created AccountConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, string $value): AccountConfigInstance { $data = Values::of([ 'Key' => $key, 'Value' => $value, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AccountConfigInstance( $this->version, $payload ); } /** * Reads AccountConfigInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AccountConfigInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AccountConfigInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AccountConfigInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AccountConfigPage Page of AccountConfigInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AccountConfigPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AccountConfigPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AccountConfigInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AccountConfigPage Page of AccountConfigInstance */ public function getPage(string $targetUrl): AccountConfigPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AccountConfigPage($this->version, $response, $this->solution); } /** * Constructs a AccountConfigContext * * @param string $key The config key; up to 100 characters. */ public function getContext( string $key ): AccountConfigContext { return new AccountConfigContext( $this->version, $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor.V1.AccountConfigList]'; } } sdk/src/Twilio/Rest/Microvisor/V1/AppInstance.php000064400000010410150364341760015645 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'hash' => Values::array_get($payload, 'hash'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AppContext Context for this AppInstance */ protected function proxy(): AppContext { if (!$this->context) { $this->context = new AppContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the AppInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AppInstance * * @return AppInstance Fetched AppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AppInstance { return $this->proxy()->fetch(); } /** * Access the appManifests */ protected function getAppManifests(): AppManifestList { return $this->proxy()->appManifests; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.AppInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/AppContext.php000064400000007570150364341760015542 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Apps/' . \rawurlencode($sid) .''; } /** * Delete the AppInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the appManifests */ protected function getAppManifests(): AppManifestList { if (!$this->_appManifests) { $this->_appManifests = new AppManifestList( $this->version, $this->solution['sid'] ); } return $this->_appManifests; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.AppContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/AppList.php000064400000011776150364341760015034 0ustar00solution = [ ]; $this->uri = '/Apps'; } /** * Reads AppInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AppInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AppInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AppInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AppPage Page of AppInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AppPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AppPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AppInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AppPage Page of AppInstance */ public function getPage(string $targetUrl): AppPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AppPage($this->version, $response, $this->solution); } /** * Constructs a AppContext * * @param string $sid A 34-character string that uniquely identifies this App. */ public function getContext( string $sid ): AppContext { return new AppContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor.V1.AppList]'; } } sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestPage.php000064400000003125150364341760017171 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return AppManifestInstance \Twilio\Rest\Microvisor\V1\App\AppManifestInstance */ public function buildInstance(array $payload): AppManifestInstance { return new AppManifestInstance($this->version, $payload, $this->solution['appSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor.V1.AppManifestPage]'; } } sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php000064400000004014150364341760017737 0ustar00solution = [ 'appSid' => $appSid, ]; $this->uri = '/Apps/' . \rawurlencode($appSid) .'/Manifest'; } /** * Fetch the AppManifestInstance * * @return AppManifestInstance Fetched AppManifestInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AppManifestInstance { $payload = $this->version->fetch('GET', $this->uri); return new AppManifestInstance( $this->version, $payload, $this->solution['appSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.AppManifestContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestInstance.php000064400000006560150364341760020067 0ustar00properties = [ 'appSid' => Values::array_get($payload, 'app_sid'), 'hash' => Values::array_get($payload, 'hash'), 'encodedBytes' => Values::array_get($payload, 'encoded_bytes'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['appSid' => $appSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AppManifestContext Context for this AppManifestInstance */ protected function proxy(): AppManifestContext { if (!$this->context) { $this->context = new AppManifestContext( $this->version, $this->solution['appSid'] ); } return $this->context; } /** * Fetch the AppManifestInstance * * @return AppManifestInstance Fetched AppManifestInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AppManifestInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.AppManifestInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Microvisor/V1/App/AppManifestList.php000064400000003064150364341760017232 0ustar00solution = [ 'appSid' => $appSid, ]; } /** * Constructs a AppManifestContext */ public function getContext( ): AppManifestContext { return new AppManifestContext( $this->version, $this->solution['appSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor.V1.AppManifestList]'; } } sdk/src/Twilio/Rest/Microvisor/V1/AccountConfigContext.php000064400000005644150364341760017544 0ustar00solution = [ 'key' => $key, ]; $this->uri = '/Configs/' . \rawurlencode($key) .''; } /** * Delete the AccountConfigInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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; up to 4096 characters. * @return AccountConfigInstance Updated AccountConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $value): AccountConfigInstance { $data = Values::of([ 'Value' => $value, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AccountConfigInstance( $this->version, $payload, $this->solution['key'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Microvisor.V1.AccountConfigContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Media.php000064400000004120150364341760012036 0ustar00mediaProcessor instead. */ protected function getMediaProcessor(): \Twilio\Rest\Media\V1\MediaProcessorList { echo "mediaProcessor is deprecated. Use v1->mediaProcessor instead."; return $this->v1->mediaProcessor; } /** * @deprecated Use v1->mediaProcessor(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextMediaProcessor(string $sid): \Twilio\Rest\Media\V1\MediaProcessorContext { echo "mediaProcessor(\$sid) is deprecated. Use v1->mediaProcessor(\$sid) instead."; return $this->v1->mediaProcessor($sid); } /** * @deprecated Use v1->mediaRecording instead. */ protected function getMediaRecording(): \Twilio\Rest\Media\V1\MediaRecordingList { echo "mediaRecording is deprecated. Use v1->mediaRecording instead."; return $this->v1->mediaRecording; } /** * @deprecated Use v1->mediaRecording(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextMediaRecording(string $sid): \Twilio\Rest\Media\V1\MediaRecordingContext { echo "mediaRecording(\$sid) is deprecated. Use v1->mediaRecording(\$sid) instead."; return $this->v1->mediaRecording($sid); } /** * @deprecated Use v1->playerStreamer instead. */ protected function getPlayerStreamer(): \Twilio\Rest\Media\V1\PlayerStreamerList { echo "playerStreamer is deprecated. Use v1->playerStreamer instead."; return $this->v1->playerStreamer; } /** * @deprecated Use v1->playerStreamer(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextPlayerStreamer(string $sid): \Twilio\Rest\Media\V1\PlayerStreamerContext { echo "playerStreamer(\$sid) is deprecated. Use v1->playerStreamer(\$sid) instead."; return $this->v1->playerStreamer($sid); } }sdk/src/Twilio/Rest/FlexApi/V1.php000064400000022226150364341760012644 0ustar00version = 'v1'; } protected function getAssessments(): AssessmentsList { if (!$this->_assessments) { $this->_assessments = new AssessmentsList($this); } return $this->_assessments; } protected function getChannel(): ChannelList { if (!$this->_channel) { $this->_channel = new ChannelList($this); } return $this->_channel; } protected function getConfiguration(): ConfigurationList { if (!$this->_configuration) { $this->_configuration = new ConfigurationList($this); } return $this->_configuration; } protected function getFlexFlow(): FlexFlowList { if (!$this->_flexFlow) { $this->_flexFlow = new FlexFlowList($this); } return $this->_flexFlow; } protected function getInsightsAssessmentsComment(): InsightsAssessmentsCommentList { if (!$this->_insightsAssessmentsComment) { $this->_insightsAssessmentsComment = new InsightsAssessmentsCommentList($this); } return $this->_insightsAssessmentsComment; } protected function getInsightsConversations(): InsightsConversationsList { if (!$this->_insightsConversations) { $this->_insightsConversations = new InsightsConversationsList($this); } return $this->_insightsConversations; } protected function getInsightsQuestionnaires(): InsightsQuestionnairesList { if (!$this->_insightsQuestionnaires) { $this->_insightsQuestionnaires = new InsightsQuestionnairesList($this); } return $this->_insightsQuestionnaires; } protected function getInsightsQuestionnairesCategory(): InsightsQuestionnairesCategoryList { if (!$this->_insightsQuestionnairesCategory) { $this->_insightsQuestionnairesCategory = new InsightsQuestionnairesCategoryList($this); } return $this->_insightsQuestionnairesCategory; } protected function getInsightsQuestionnairesQuestion(): InsightsQuestionnairesQuestionList { if (!$this->_insightsQuestionnairesQuestion) { $this->_insightsQuestionnairesQuestion = new InsightsQuestionnairesQuestionList($this); } return $this->_insightsQuestionnairesQuestion; } protected function getInsightsSegments(): InsightsSegmentsList { if (!$this->_insightsSegments) { $this->_insightsSegments = new InsightsSegmentsList($this); } return $this->_insightsSegments; } protected function getInsightsSession(): InsightsSessionList { if (!$this->_insightsSession) { $this->_insightsSession = new InsightsSessionList($this); } return $this->_insightsSession; } protected function getInsightsSettingsAnswerSets(): InsightsSettingsAnswerSetsList { if (!$this->_insightsSettingsAnswerSets) { $this->_insightsSettingsAnswerSets = new InsightsSettingsAnswerSetsList($this); } return $this->_insightsSettingsAnswerSets; } protected function getInsightsSettingsComment(): InsightsSettingsCommentList { if (!$this->_insightsSettingsComment) { $this->_insightsSettingsComment = new InsightsSettingsCommentList($this); } return $this->_insightsSettingsComment; } protected function getInsightsUserRoles(): InsightsUserRolesList { if (!$this->_insightsUserRoles) { $this->_insightsUserRoles = new InsightsUserRolesList($this); } return $this->_insightsUserRoles; } protected function getInteraction(): InteractionList { if (!$this->_interaction) { $this->_interaction = new InteractionList($this); } return $this->_interaction; } protected function 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]'; } } sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsPage.php000064400000003043150364341760015627 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsInstance.php000064400000004156150364341760016525 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsList.php000064400000004777150364341760015705 0ustar00solution = [ ]; $this->uri = '/WebChats'; } /** * Create the WebChannelsInstance * * @param string $addressSid The SID of the Conversations Address. See [Address Configuration Resource](https://www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration. * @param array|Options $options Optional Arguments * @return WebChannelsInstance Created WebChannelsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $addressSid, array $options = []): WebChannelsInstance { $options = new Values($options); $data = Values::of([ 'AddressSid' => $addressSid, 'ChatFriendlyName' => $options['chatFriendlyName'], 'CustomerFriendlyName' => $options['customerFriendlyName'], 'PreEngagementData' => $options['preEngagementData'], ]); $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]'; } } sdk/src/Twilio/Rest/FlexApi/V2/WebChannelsOptions.php000064400000010525150364341760016411 0ustar00options['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. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. * @return $this Fluent Builder */ public function setChatFriendlyName(string $chatFriendlyName): self { $this->options['chatFriendlyName'] = $chatFriendlyName; return $this; } /** * The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. * * @param string $customerFriendlyName The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. * @return $this Fluent Builder */ public function setCustomerFriendlyName(string $customerFriendlyName): self { $this->options['customerFriendlyName'] = $customerFriendlyName; return $this; } /** * The pre-engagement data. * * @param string $preEngagementData The pre-engagement data. * @return $this Fluent Builder */ public function setPreEngagementData(string $preEngagementData): self { $this->options['preEngagementData'] = $preEngagementData; return $this; } /** * 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 . ']'; } } sdk/src/Twilio/Rest/FlexApi/V2.php000064400000005022150364341760012640 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentList.php000064400000003757150364341760020344 0ustar00solution = [ ]; $this->uri = '/Insights/QualityManagement/Settings/CommentTags'; } /** * Fetch the InsightsSettingsCommentInstance * * @param array|Options $options Optional Arguments * @return InsightsSettingsCommentInstance Fetched InsightsSettingsCommentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): InsightsSettingsCommentInstance { $options = new Values($options); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); return new InsightsSettingsCommentInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsSettingsCommentList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelList.php000064400000014765150364341760015517 0ustar00solution = [ ]; $this->uri = '/WebChannels'; } /** * Create the WebChannelInstance * * @param string $flexFlowSid The SID of the Flex Flow. * @param string $identity The chat identity. * @param string $customerFriendlyName The chat participant's friendly name. * @param string $chatFriendlyName The chat channel's friendly name. * @param array|Options $options Optional Arguments * @return WebChannelInstance Created WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $flexFlowSid, string $identity, string $customerFriendlyName, string $chatFriendlyName, array $options = []): WebChannelInstance { $options = new Values($options); $data = Values::of([ 'FlexFlowSid' => $flexFlowSid, 'Identity' => $identity, 'CustomerFriendlyName' => $customerFriendlyName, 'ChatFriendlyName' => $chatFriendlyName, 'ChatUniqueName' => $options['chatUniqueName'], 'PreEngagementData' => $options['preEngagementData'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebChannelInstance( $this->version, $payload ); } /** * Reads WebChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebChannelPage Page of WebChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebChannelPage Page of WebChannelInstance */ public function getPage(string $targetUrl): WebChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebChannelPage($this->version, $response, $this->solution); } /** * Constructs a WebChannelContext * * @param string $sid The SID of the WebChannel resource to delete. */ public function getContext( string $sid ): WebChannelContext { return new WebChannelContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.WebChannelList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesList.php000064400000002601150364341760017127 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionOptions.php000064400000023251150364341760022471 0ustar00options['description'] = $description; $this->options['authorization'] = $authorization; } /** * The description for the question. * * @param string $description The description for the question. * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesQuestionOptions ' . $options . ']'; } } class DeleteInsightsQuestionnairesQuestionOptions extends Options { /** * @param string $authorization The Authorization HTTP request header */ public function __construct( string $authorization = Values::NONE ) { $this->options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesQuestionOptions ' . $options . ']'; } } class ReadInsightsQuestionnairesQuestionOptions extends Options { /** * @param string[] $categorySid The list of category SIDs * @param string $authorization The Authorization HTTP request header */ public function __construct( array $categorySid = Values::ARRAY_NONE, string $authorization = Values::NONE ) { $this->options['categorySid'] = $categorySid; $this->options['authorization'] = $authorization; } /** * The list of category SIDs * * @param string[] $categorySid The list of category SIDs * @return $this Fluent Builder */ public function setCategorySid(array $categorySid): self { $this->options['categorySid'] = $categorySid; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesQuestionOptions ' . $options . ']'; } } class UpdateInsightsQuestionnairesQuestionOptions extends Options { /** * @param string $categorySid The SID of the category * @param string $question The question. * @param string $description The description for the question. * @param string $answerSetId The answer_set for the question. * @param string $authorization The Authorization HTTP request header */ public function __construct( string $categorySid = Values::NONE, string $question = Values::NONE, string $description = Values::NONE, string $answerSetId = Values::NONE, string $authorization = Values::NONE ) { $this->options['categorySid'] = $categorySid; $this->options['question'] = $question; $this->options['description'] = $description; $this->options['answerSetId'] = $answerSetId; $this->options['authorization'] = $authorization; } /** * The SID of the category * * @param string $categorySid The SID of the category * @return $this Fluent Builder */ public function setCategorySid(string $categorySid): self { $this->options['categorySid'] = $categorySid; return $this; } /** * The question. * * @param string $question The question. * @return $this Fluent Builder */ public function setQuestion(string $question): self { $this->options['question'] = $question; return $this; } /** * The description for the question. * * @param string $description The description for the question. * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * The answer_set for the question. * * @param string $answerSetId The answer_set for the question. * @return $this Fluent Builder */ public function setAnswerSetId(string $answerSetId): self { $this->options['answerSetId'] = $answerSetId; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesQuestionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionContext.php000064400000004104150364341760017340 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsPage.php000064400000003175150364341760020773 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionInstance.php000064400000011424150364341760022601 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'questionSid' => Values::array_get($payload, 'question_sid'), 'question' => Values::array_get($payload, 'question'), 'description' => Values::array_get($payload, 'description'), 'category' => Values::array_get($payload, 'category'), 'answerSetId' => Values::array_get($payload, 'answer_set_id'), 'allowNa' => Values::array_get($payload, 'allow_na'), 'usage' => Values::array_get($payload, 'usage'), 'answerSet' => Values::array_get($payload, 'answer_set'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['questionSid' => $questionSid ?: $this->properties['questionSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InsightsQuestionnairesQuestionContext Context for this InsightsQuestionnairesQuestionInstance */ protected function proxy(): InsightsQuestionnairesQuestionContext { if (!$this->context) { $this->context = new InsightsQuestionnairesQuestionContext( $this->version, $this->solution['questionSid'] ); } return $this->context; } /** * Delete the InsightsQuestionnairesQuestionInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Update the InsightsQuestionnairesQuestionInstance * * @param bool $allowNa The flag to enable for disable NA for answer. * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesQuestionInstance Updated InsightsQuestionnairesQuestionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance { return $this->proxy()->update($allowNa, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsPage.php000064400000003043150364341760015745 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelList.php000064400000013225150364341760021526 0ustar00solution = [ 'interactionSid' => $interactionSid, ]; $this->uri = '/Interactions/' . \rawurlencode($interactionSid) .'/Channels'; } /** * Reads InteractionChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InteractionChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InteractionChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InteractionChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InteractionChannelPage Page of InteractionChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InteractionChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InteractionChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InteractionChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InteractionChannelPage Page of InteractionChannelInstance */ public function getPage(string $targetUrl): InteractionChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InteractionChannelPage($this->version, $response, $this->solution); } /** * Constructs a InteractionChannelContext * * @param string $sid The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO. */ public function getContext( string $sid ): InteractionChannelContext { return new InteractionChannelContext( $this->version, $this->solution['interactionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InteractionChannelList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantPage.php000064400000003417150364341760027440 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteList.php000064400000014431150364341760026455 0ustar00solution = [ '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'] ); } /** * Reads InteractionChannelInviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InteractionChannelInviteInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InteractionChannelInviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InteractionChannelInviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InteractionChannelInvitePage Page of InteractionChannelInviteInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InteractionChannelInvitePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InteractionChannelInvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InteractionChannelInviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InteractionChannelInvitePage Page of InteractionChannelInviteInstance */ public function getPage(string $targetUrl): InteractionChannelInvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InteractionChannelInvitePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InteractionChannelInviteList]'; } } src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantInstance.php000064400000010206150364341760030243 0ustar00sdkproperties = [ '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 * @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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantList.php000064400000016067150364341760027504 0ustar00solution = [ 'interactionSid' => $interactionSid, 'channelSid' => $channelSid, ]; $this->uri = '/Interactions/' . \rawurlencode($interactionSid) .'/Channels/' . \rawurlencode($channelSid) .'/Participants'; } /** * Create the InteractionChannelParticipantInstance * * @param string $type * @param array $mediaProperties JSON representing the Media Properties for the new Participant. * @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'] ); } /** * Reads InteractionChannelParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InteractionChannelParticipantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InteractionChannelParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InteractionChannelParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InteractionChannelParticipantPage Page of InteractionChannelParticipantInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InteractionChannelParticipantPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InteractionChannelParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InteractionChannelParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InteractionChannelParticipantPage Page of InteractionChannelParticipantInstance */ public function getPage(string $targetUrl): InteractionChannelParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InteractionChannelParticipantPage($this->version, $response, $this->solution); } /** * Constructs a InteractionChannelParticipantContext * * @param string $sid The unique string created by Twilio to identify an Interaction Channel resource. */ public function getContext( string $sid ): InteractionChannelParticipantContext { return new InteractionChannelParticipantContext( $this->version, $this->solution['interactionSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InteractionChannelParticipantList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInvitePage.php000064400000003361150364341760026416 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteInstance.php000064400000005303150364341760027304 0ustar00properties = [ '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]'; } } src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantContext.php000064400000005544150364341760030134 0ustar00sdksolution = [ 'interactionSid' => $interactionSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Interactions/' . \rawurlencode($interactionSid) .'/Channels/' . \rawurlencode($channelSid) .'/Participants/' . \rawurlencode($sid) .''; } /** * Update the InteractionChannelParticipantInstance * * @param string $status * @return InteractionChannelParticipantInstance Updated InteractionChannelParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): InteractionChannelParticipantInstance { $data = Values::of([ 'Status' => $status, ]); $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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelPage.php000064400000003210150364341760021460 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelOptions.php000064400000005257150364341760022254 0ustar00options['routing'] = $routing; } /** * It changes the state of associated tasks. Routing status is required, When the channel status is set to `inactive`. Allowed Value for routing status is `closed`. Otherwise Optional, if not specified, all tasks will be set to `wrapping`. * * @param array $routing It changes the state of associated tasks. Routing status is required, When the channel status is set to `inactive`. Allowed Value for routing status is `closed`. Otherwise Optional, if not specified, all tasks will be set to `wrapping`. * @return $this Fluent Builder */ public function setRouting(array $routing): self { $this->options['routing'] = $routing; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.UpdateInteractionChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelInstance.php000064400000012212150364341760022352 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'interactionSid' => Values::array_get($payload, 'interaction_sid'), 'type' => Values::array_get($payload, 'type'), 'status' => Values::array_get($payload, 'status'), 'errorCode' => Values::array_get($payload, 'error_code'), 'errorMessage' => Values::array_get($payload, 'error_message'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['interactionSid' => $interactionSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InteractionChannelContext Context for this InteractionChannelInstance */ protected function proxy(): InteractionChannelContext { if (!$this->context) { $this->context = new InteractionChannelContext( $this->version, $this->solution['interactionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the InteractionChannelInstance * * @return InteractionChannelInstance Fetched InteractionChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InteractionChannelInstance { return $this->proxy()->fetch(); } /** * Update the InteractionChannelInstance * * @param string $status * @param array|Options $options Optional Arguments * @return InteractionChannelInstance Updated InteractionChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): InteractionChannelInstance { return $this->proxy()->update($status, $options); } /** * Access the participants */ protected function getParticipants(): InteractionChannelParticipantList { return $this->proxy()->participants; } /** * Access the invites */ protected function getInvites(): InteractionChannelInviteList { return $this->proxy()->invites; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InteractionChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php000064400000013343150364341760022240 0ustar00solution = [ '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 * @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 participants */ protected function getParticipants(): InteractionChannelParticipantList { if (!$this->_participants) { $this->_participants = new InteractionChannelParticipantList( $this->version, $this->solution['interactionSid'], $this->solution['sid'] ); } return $this->_participants; } /** * Access the invites */ protected function getInvites(): InteractionChannelInviteList { if (!$this->_invites) { $this->_invites = new InteractionChannelInviteList( $this->version, $this->solution['interactionSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InteractionChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentPage.php000064400000003153150364341760020273 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsList.php000064400000017231150364341760016010 0ustar00solution = [ ]; $this->uri = '/Insights/QualityManagement/Assessments'; } /** * Create the AssessmentsInstance * * @param string $categorySid The SID of the category * @param string $categoryName The name of the category * @param string $segmentId Segment Id of the conversation * @param string $agentId The id of the Agent * @param string $offset The offset of the conversation. * @param string $metricId The question SID selected for assessment * @param string $metricName The question name of the assessment * @param string $answerText The answer text selected by user * @param string $answerId The id of the answer selected by user * @param string $questionnaireSid Questionnaire SID of the associated question * @param array|Options $options Optional Arguments * @return AssessmentsInstance Created AssessmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $categorySid, string $categoryName, string $segmentId, string $agentId, string $offset, string $metricId, string $metricName, string $answerText, string $answerId, string $questionnaireSid, array $options = []): AssessmentsInstance { $options = new Values($options); $data = Values::of([ 'CategorySid' => $categorySid, 'CategoryName' => $categoryName, 'SegmentId' => $segmentId, 'AgentId' => $agentId, 'Offset' => $offset, 'MetricId' => $metricId, 'MetricName' => $metricName, 'AnswerText' => $answerText, 'AnswerId' => $answerId, 'QuestionnaireSid' => $questionnaireSid, ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new AssessmentsInstance( $this->version, $payload ); } /** * Reads AssessmentsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssessmentsInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AssessmentsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssessmentsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssessmentsPage Page of AssessmentsInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssessmentsPage { $options = new Values($options); $params = Values::of([ 'SegmentId' => $options['segmentId'], 'Authorization' => $options['authorization'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssessmentsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssessmentsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssessmentsPage Page of AssessmentsInstance */ public function getPage(string $targetUrl): AssessmentsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssessmentsPage($this->version, $response, $this->solution); } /** * Constructs a AssessmentsContext * * @param string $assessmentSid The SID of the assessment to be modified */ public function getContext( string $assessmentSid ): AssessmentsContext { return new AssessmentsContext( $this->version, $assessmentSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.AssessmentsList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsInstance.php000064400000004746150364341760021670 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InteractionOptions.php000064400000004165150364341760016501 0ustar00options['interactionContextSid'] = $interactionContextSid; } /** * The Interaction context sid is used for adding a context lookup sid * * @param string $interactionContextSid The Interaction context sid is used for adding a context lookup sid * @return $this Fluent Builder */ public function setInteractionContextSid(string $interactionContextSid): self { $this->options['interactionContextSid'] = $interactionContextSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateInteractionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesPage.php000064400000003145150364341760020162 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsOptions.php000064400000012046150364341760016527 0ustar00options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateAssessmentsOptions ' . $options . ']'; } } class ReadAssessmentsOptions extends Options { /** * @param string $segmentId The id of the segment. * @param string $authorization The Authorization HTTP request header */ public function __construct( string $segmentId = Values::NONE, string $authorization = Values::NONE ) { $this->options['segmentId'] = $segmentId; $this->options['authorization'] = $authorization; } /** * The id of the segment. * * @param string $segmentId The id of the segment. * @return $this Fluent Builder */ public function setSegmentId(string $segmentId): self { $this->options['segmentId'] = $segmentId; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.ReadAssessmentsOptions ' . $options . ']'; } } class UpdateAssessmentsOptions extends Options { /** * @param string $authorization The Authorization HTTP request header */ public function __construct( string $authorization = Values::NONE ) { $this->options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.UpdateAssessmentsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsInstance.php000064400000010601150364341760017621 0ustar00properties = [ 'segmentId' => Values::array_get($payload, 'segment_id'), 'externalId' => Values::array_get($payload, 'external_id'), 'queue' => Values::array_get($payload, 'queue'), 'externalContact' => Values::array_get($payload, 'external_contact'), 'externalSegmentLinkId' => Values::array_get($payload, 'external_segment_link_id'), 'date' => Values::array_get($payload, 'date'), 'accountId' => Values::array_get($payload, 'account_id'), 'externalSegmentLink' => Values::array_get($payload, 'external_segment_link'), 'agentId' => Values::array_get($payload, 'agent_id'), 'agentPhone' => Values::array_get($payload, 'agent_phone'), 'agentName' => Values::array_get($payload, 'agent_name'), 'agentTeamName' => Values::array_get($payload, 'agent_team_name'), 'agentTeamNameInHierarchy' => Values::array_get($payload, 'agent_team_name_in_hierarchy'), 'agentLink' => Values::array_get($payload, 'agent_link'), 'customerPhone' => Values::array_get($payload, 'customer_phone'), 'customerName' => Values::array_get($payload, 'customer_name'), 'customerLink' => Values::array_get($payload, 'customer_link'), 'segmentRecordingOffset' => Values::array_get($payload, 'segment_recording_offset'), 'media' => Values::array_get($payload, 'media'), 'assessmentType' => Values::array_get($payload, 'assessment_type'), 'assessmentPercentage' => Values::array_get($payload, 'assessment_percentage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsSegmentsInstance]'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowInstance.php000064400000012207150364341760016055 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'channelType' => Values::array_get($payload, 'channel_type'), 'contactIdentity' => Values::array_get($payload, 'contact_identity'), 'enabled' => Values::array_get($payload, 'enabled'), 'integrationType' => Values::array_get($payload, 'integration_type'), 'integration' => Values::array_get($payload, 'integration'), 'longLived' => Values::array_get($payload, 'long_lived'), 'janitorEnabled' => Values::array_get($payload, 'janitor_enabled'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FlexFlowContext Context for this FlexFlowInstance */ protected function proxy(): FlexFlowContext { if (!$this->context) { $this->context = new FlexFlowContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the FlexFlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FlexFlowInstance * * @return FlexFlowInstance Fetched FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlexFlowInstance { return $this->proxy()->fetch(); } /** * Update the FlexFlowInstance * * @param array|Options $options Optional Arguments * @return FlexFlowInstance Updated FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FlexFlowInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.FlexFlowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryOptions.php000064400000014300150364341760022432 0ustar00options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesCategoryOptions ' . $options . ']'; } } class DeleteInsightsQuestionnairesCategoryOptions extends Options { /** * @param string $authorization The Authorization HTTP request header */ public function __construct( string $authorization = Values::NONE ) { $this->options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesCategoryOptions ' . $options . ']'; } } class ReadInsightsQuestionnairesCategoryOptions extends Options { /** * @param string $authorization The Authorization HTTP request header */ public function __construct( string $authorization = Values::NONE ) { $this->options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesCategoryOptions ' . $options . ']'; } } class UpdateInsightsQuestionnairesCategoryOptions extends Options { /** * @param string $authorization The Authorization HTTP request header */ public function __construct( string $authorization = Values::NONE ) { $this->options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesCategoryOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionPage.php000064400000003073150364341760016574 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentPage.php000064400000003175150364341760021007 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelOptions.php000064400000010454150364341760016226 0ustar00options['chatUniqueName'] = $chatUniqueName; $this->options['preEngagementData'] = $preEngagementData; } /** * The chat channel's unique name. * * @param string $chatUniqueName The chat channel's unique name. * @return $this Fluent Builder */ public function setChatUniqueName(string $chatUniqueName): self { $this->options['chatUniqueName'] = $chatUniqueName; return $this; } /** * The pre-engagement data. * * @param string $preEngagementData The pre-engagement data. * @return $this Fluent Builder */ public function setPreEngagementData(string $preEngagementData): self { $this->options['preEngagementData'] = $preEngagementData; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateWebChannelOptions ' . $options . ']'; } } class UpdateWebChannelOptions extends Options { /** * @param string $chatStatus * @param string $postEngagementData The post-engagement data. */ public function __construct( string $chatStatus = Values::NONE, string $postEngagementData = Values::NONE ) { $this->options['chatStatus'] = $chatStatus; $this->options['postEngagementData'] = $postEngagementData; } /** * @param string $chatStatus * @return $this Fluent Builder */ public function setChatStatus(string $chatStatus): self { $this->options['chatStatus'] = $chatStatus; return $this; } /** * The post-engagement data. * * @param string $postEngagementData The post-engagement data. * @return $this Fluent Builder */ public function setPostEngagementData(string $postEngagementData): self { $this->options['postEngagementData'] = $postEngagementData; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.UpdateWebChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php000064400000003721150364341760017026 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionContext.php000064400000006664150364341760022473 0ustar00solution = [ 'questionSid' => $questionSid, ]; $this->uri = '/Insights/QualityManagement/Questions/' . \rawurlencode($questionSid) .''; } /** * Delete the InsightsQuestionnairesQuestionInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['Authorization' => $options['authorization']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Update the InsightsQuestionnairesQuestionInstance * * @param bool $allowNa The flag to enable for disable NA for answer. * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesQuestionInstance Updated InsightsQuestionnairesQuestionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance { $options = new Values($options); $data = Values::of([ 'AllowNa' => Serialize::booleanToString($allowNa), 'CategorySid' => $options['categorySid'], 'Question' => $options['question'], 'Description' => $options['description'], 'AnswerSetId' => $options['answerSetId'], ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesQuestionInstance( $this->version, $payload, $this->solution['questionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionInstance.php000064400000006726150364341760017474 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsPage.php000064400000003137150364341760020007 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return InsightsConversationsInstance \Twilio\Rest\FlexApi\V1\InsightsConversationsInstance */ public function buildInstance(array $payload): InsightsConversationsInstance { return new InsightsConversationsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsConversationsPage]'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelInstance.php000064400000010440150364341760016332 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'flexFlowSid' => Values::array_get($payload, 'flex_flow_sid'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebChannelContext Context for this WebChannelInstance */ protected function proxy(): WebChannelContext { if (!$this->context) { $this->context = new WebChannelContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the WebChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebChannelInstance * * @return WebChannelInstance Fetched WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebChannelInstance { return $this->proxy()->fetch(); } /** * Update the WebChannelInstance * * @param array|Options $options Optional Arguments * @return WebChannelInstance Updated WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebChannelInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.WebChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesPage.php000064400000003107150364341760017072 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesList.php000064400000015743150364341760020230 0ustar00solution = [ ]; $this->uri = '/Insights/QualityManagement/Questionnaires'; } /** * Create the InsightsQuestionnairesInstance * * @param string $name The name of this questionnaire * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesInstance Created InsightsQuestionnairesInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $name, array $options = []): InsightsQuestionnairesInstance { $options = new Values($options); $data = Values::of([ 'Name' => $name, 'Description' => $options['description'], 'Active' => Serialize::booleanToString($options['active']), 'QuestionSids' => Serialize::map($options['questionSids'], function ($e) { return $e; }), ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesInstance( $this->version, $payload ); } /** * Reads InsightsQuestionnairesInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InsightsQuestionnairesInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InsightsQuestionnairesInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InsightsQuestionnairesInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InsightsQuestionnairesPage Page of InsightsQuestionnairesInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InsightsQuestionnairesPage { $options = new Values($options); $params = Values::of([ 'IncludeInactive' => Serialize::booleanToString($options['includeInactive']), 'Authorization' => $options['authorization'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InsightsQuestionnairesPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InsightsQuestionnairesInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InsightsQuestionnairesPage Page of InsightsQuestionnairesInstance */ public function getPage(string $targetUrl): InsightsQuestionnairesPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InsightsQuestionnairesPage($this->version, $response, $this->solution); } /** * Constructs a InsightsQuestionnairesContext * * @param string $questionnaireSid The SID of the questionnaire */ public function getContext( string $questionnaireSid ): InsightsQuestionnairesContext { return new InsightsQuestionnairesContext( $this->version, $questionnaireSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsQuestionnairesList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowOptions.php000064400000103230150364341760015741 0ustar00options['contactIdentity'] = $contactIdentity; $this->options['enabled'] = $enabled; $this->options['integrationType'] = $integrationType; $this->options['integrationFlowSid'] = $integrationFlowSid; $this->options['integrationUrl'] = $integrationUrl; $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; $this->options['integrationChannel'] = $integrationChannel; $this->options['integrationTimeout'] = $integrationTimeout; $this->options['integrationPriority'] = $integrationPriority; $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; $this->options['longLived'] = $longLived; $this->options['janitorEnabled'] = $janitorEnabled; $this->options['integrationRetryCount'] = $integrationRetryCount; } /** * The channel contact's Identity. * * @param string $contactIdentity The channel contact's Identity. * @return $this Fluent Builder */ public function setContactIdentity(string $contactIdentity): self { $this->options['contactIdentity'] = $contactIdentity; return $this; } /** * Whether the new Flex Flow is enabled. * * @param bool $enabled Whether the new Flex Flow is enabled. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * @param string $integrationType * @return $this Fluent Builder */ public function setIntegrationType(string $integrationType): self { $this->options['integrationType'] = $integrationType; return $this; } /** * The SID of the Studio Flow. Required when `integrationType` is `studio`. * * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. * @return $this Fluent Builder */ public function setIntegrationFlowSid(string $integrationFlowSid): self { $this->options['integrationFlowSid'] = $integrationFlowSid; return $this; } /** * The URL of the external webhook. Required when `integrationType` is `external`. * * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. * @return $this Fluent Builder */ public function setIntegrationUrl(string $integrationUrl): self { $this->options['integrationUrl'] = $integrationUrl; return $this; } /** * The Workspace SID for a new Task. Required when `integrationType` is `task`. * * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. * @return $this Fluent Builder */ public function setIntegrationWorkspaceSid(string $integrationWorkspaceSid): self { $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; return $this; } /** * The Workflow SID for a new Task. Required when `integrationType` is `task`. * * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. * @return $this Fluent Builder */ public function setIntegrationWorkflowSid(string $integrationWorkflowSid): self { $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; return $this; } /** * The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. * * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. * @return $this Fluent Builder */ public function setIntegrationChannel(string $integrationChannel): self { $this->options['integrationChannel'] = $integrationChannel; return $this; } /** * The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. * * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. * @return $this Fluent Builder */ public function setIntegrationTimeout(int $integrationTimeout): self { $this->options['integrationTimeout'] = $integrationTimeout; return $this; } /** * The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. * * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. * @return $this Fluent Builder */ public function setIntegrationPriority(int $integrationPriority): self { $this->options['integrationPriority'] = $integrationPriority; return $this; } /** * In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. * * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. * @return $this Fluent Builder */ public function setIntegrationCreationOnMessage(bool $integrationCreationOnMessage): self { $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; return $this; } /** * When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. * * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. * @return $this Fluent Builder */ public function setLongLived(bool $longLived): self { $this->options['longLived'] = $longLived; return $this; } /** * When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. * * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. * @return $this Fluent Builder */ public function setJanitorEnabled(bool $janitorEnabled): self { $this->options['janitorEnabled'] = $janitorEnabled; return $this; } /** * The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. * * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. * @return $this Fluent Builder */ public function setIntegrationRetryCount(int $integrationRetryCount): self { $this->options['integrationRetryCount'] = $integrationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateFlexFlowOptions ' . $options . ']'; } } class ReadFlexFlowOptions extends Options { /** * @param string $friendlyName The `friendly_name` of the Flex Flow resources to read. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * The `friendly_name` of the Flex Flow resources to read. * * @param string $friendlyName The `friendly_name` of the Flex Flow resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.ReadFlexFlowOptions ' . $options . ']'; } } class UpdateFlexFlowOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. * @param string $chatServiceSid The SID of the chat service. * @param string $channelType * @param string $contactIdentity The channel contact's Identity. * @param bool $enabled Whether the new Flex Flow is enabled. * @param string $integrationType * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. */ public function __construct( string $friendlyName = Values::NONE, string $chatServiceSid = Values::NONE, string $channelType = Values::NONE, string $contactIdentity = Values::NONE, bool $enabled = Values::BOOL_NONE, string $integrationType = Values::NONE, string $integrationFlowSid = Values::NONE, string $integrationUrl = Values::NONE, string $integrationWorkspaceSid = Values::NONE, string $integrationWorkflowSid = Values::NONE, string $integrationChannel = Values::NONE, int $integrationTimeout = Values::INT_NONE, int $integrationPriority = Values::INT_NONE, bool $integrationCreationOnMessage = Values::BOOL_NONE, bool $longLived = Values::BOOL_NONE, bool $janitorEnabled = Values::BOOL_NONE, int $integrationRetryCount = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['chatServiceSid'] = $chatServiceSid; $this->options['channelType'] = $channelType; $this->options['contactIdentity'] = $contactIdentity; $this->options['enabled'] = $enabled; $this->options['integrationType'] = $integrationType; $this->options['integrationFlowSid'] = $integrationFlowSid; $this->options['integrationUrl'] = $integrationUrl; $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; $this->options['integrationChannel'] = $integrationChannel; $this->options['integrationTimeout'] = $integrationTimeout; $this->options['integrationPriority'] = $integrationPriority; $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; $this->options['longLived'] = $longLived; $this->options['janitorEnabled'] = $janitorEnabled; $this->options['integrationRetryCount'] = $integrationRetryCount; } /** * A descriptive string that you create to describe the Flex Flow resource. * * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the chat service. * * @param string $chatServiceSid The SID of the chat service. * @return $this Fluent Builder */ public function setChatServiceSid(string $chatServiceSid): self { $this->options['chatServiceSid'] = $chatServiceSid; return $this; } /** * @param string $channelType * @return $this Fluent Builder */ public function setChannelType(string $channelType): self { $this->options['channelType'] = $channelType; return $this; } /** * The channel contact's Identity. * * @param string $contactIdentity The channel contact's Identity. * @return $this Fluent Builder */ public function setContactIdentity(string $contactIdentity): self { $this->options['contactIdentity'] = $contactIdentity; return $this; } /** * Whether the new Flex Flow is enabled. * * @param bool $enabled Whether the new Flex Flow is enabled. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * @param string $integrationType * @return $this Fluent Builder */ public function setIntegrationType(string $integrationType): self { $this->options['integrationType'] = $integrationType; return $this; } /** * The SID of the Studio Flow. Required when `integrationType` is `studio`. * * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. * @return $this Fluent Builder */ public function setIntegrationFlowSid(string $integrationFlowSid): self { $this->options['integrationFlowSid'] = $integrationFlowSid; return $this; } /** * The URL of the external webhook. Required when `integrationType` is `external`. * * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. * @return $this Fluent Builder */ public function setIntegrationUrl(string $integrationUrl): self { $this->options['integrationUrl'] = $integrationUrl; return $this; } /** * The Workspace SID for a new Task. Required when `integrationType` is `task`. * * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. * @return $this Fluent Builder */ public function setIntegrationWorkspaceSid(string $integrationWorkspaceSid): self { $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; return $this; } /** * The Workflow SID for a new Task. Required when `integrationType` is `task`. * * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. * @return $this Fluent Builder */ public function setIntegrationWorkflowSid(string $integrationWorkflowSid): self { $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; return $this; } /** * The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. * * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. * @return $this Fluent Builder */ public function setIntegrationChannel(string $integrationChannel): self { $this->options['integrationChannel'] = $integrationChannel; return $this; } /** * The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. * * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. * @return $this Fluent Builder */ public function setIntegrationTimeout(int $integrationTimeout): self { $this->options['integrationTimeout'] = $integrationTimeout; return $this; } /** * The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. * * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. * @return $this Fluent Builder */ public function setIntegrationPriority(int $integrationPriority): self { $this->options['integrationPriority'] = $integrationPriority; return $this; } /** * In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. * * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. * @return $this Fluent Builder */ public function setIntegrationCreationOnMessage(bool $integrationCreationOnMessage): self { $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; return $this; } /** * When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. * * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. * @return $this Fluent Builder */ public function setLongLived(bool $longLived): self { $this->options['longLived'] = $longLived; return $this; } /** * When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. * * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. * @return $this Fluent Builder */ public function setJanitorEnabled(bool $janitorEnabled): self { $this->options['janitorEnabled'] = $janitorEnabled; return $this; } /** * The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. * * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. * @return $this Fluent Builder */ public function setIntegrationRetryCount(int $integrationRetryCount): self { $this->options['integrationRetryCount'] = $integrationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.UpdateFlexFlowOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php000064400000010516150364341760015736 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/FlexFlows/' . \rawurlencode($sid) .''; } /** * Delete the FlexFlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationPage.php000064400000003057150364341760016251 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelList.php000064400000015444150364341760015054 0ustar00solution = [ ]; $this->uri = '/Channels'; } /** * Create the ChannelInstance * * @param string $flexFlowSid The SID of the Flex Flow. * @param string $identity The `identity` value that uniquely identifies the new resource's chat User. * @param string $chatUserFriendlyName The chat participant's friendly name. * @param string $chatFriendlyName The chat channel's friendly name. * @param array|Options $options Optional Arguments * @return ChannelInstance Created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $flexFlowSid, string $identity, string $chatUserFriendlyName, string $chatFriendlyName, array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FlexFlowSid' => $flexFlowSid, 'Identity' => $identity, 'ChatUserFriendlyName' => $chatUserFriendlyName, 'ChatFriendlyName' => $chatFriendlyName, 'Target' => $options['target'], 'ChatUniqueName' => $options['chatUniqueName'], 'PreEngagementData' => $options['preEngagementData'], 'TaskSid' => $options['taskSid'], 'TaskAttributes' => $options['taskAttributes'], 'LongLived' => Serialize::booleanToString($options['longLived']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ChannelInstance( $this->version, $payload ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The SID of the Flex chat channel resource to delete. */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.ChannelList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelPage.php000064400000003013150364341760015002 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesOptions.php000064400000003671150364341760017657 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsOptions.php000064400000006152150364341760017516 0ustar00options['segmentId'] = $segmentId; $this->options['reservationId'] = $reservationId; $this->options['authorization'] = $authorization; } /** * To unique id of the segment * * @param string $segmentId To unique id of the segment * @return $this Fluent Builder */ public function setSegmentId(string $segmentId): self { $this->options['segmentId'] = $segmentId; return $this; } /** * The list of reservation Ids * * @param string[] $reservationId The list of reservation Ids * @return $this Fluent Builder */ public function setReservationId(array $reservationId): self { $this->options['reservationId'] = $reservationId; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.ReadInsightsSegmentsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php000064400000006032150364341760016214 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/WebChannels/' . \rawurlencode($sid) .''; } /** * Delete the WebChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryInstance.php000064400000010224150364341760022544 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'categorySid' => Values::array_get($payload, 'category_sid'), 'name' => Values::array_get($payload, 'name'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['categorySid' => $categorySid ?: $this->properties['categorySid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InsightsQuestionnairesCategoryContext Context for this InsightsQuestionnairesCategoryInstance */ protected function proxy(): InsightsQuestionnairesCategoryContext { if (!$this->context) { $this->context = new InsightsQuestionnairesCategoryContext( $this->version, $this->solution['categorySid'] ); } return $this->context; } /** * Delete the InsightsQuestionnairesCategoryInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Update the InsightsQuestionnairesCategoryInstance * * @param string $name The name of this category. * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesCategoryInstance Updated InsightsQuestionnairesCategoryInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $name, array $options = []): InsightsQuestionnairesCategoryInstance { return $this->proxy()->update($name, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionList.php000064400000016612150364341760021754 0ustar00solution = [ ]; $this->uri = '/Insights/QualityManagement/Questions'; } /** * Create the InsightsQuestionnairesQuestionInstance * * @param string $categorySid The SID of the category * @param string $question The question. * @param string $answerSetId The answer_set for the question. * @param bool $allowNa The flag to enable for disable NA for answer. * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesQuestionInstance Created InsightsQuestionnairesQuestionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $categorySid, string $question, string $answerSetId, bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance { $options = new Values($options); $data = Values::of([ 'CategorySid' => $categorySid, 'Question' => $question, 'AnswerSetId' => $answerSetId, 'AllowNa' => Serialize::booleanToString($allowNa), 'Description' => $options['description'], ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesQuestionInstance( $this->version, $payload ); } /** * Reads InsightsQuestionnairesQuestionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InsightsQuestionnairesQuestionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InsightsQuestionnairesQuestionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InsightsQuestionnairesQuestionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InsightsQuestionnairesQuestionPage Page of InsightsQuestionnairesQuestionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InsightsQuestionnairesQuestionPage { $options = new Values($options); $params = Values::of([ 'CategorySid' => Serialize::map($options['categorySid'], function ($e) { return $e; }), 'Authorization' => $options['authorization'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InsightsQuestionnairesQuestionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InsightsQuestionnairesQuestionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InsightsQuestionnairesQuestionPage Page of InsightsQuestionnairesQuestionInstance */ public function getPage(string $targetUrl): InsightsQuestionnairesQuestionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InsightsQuestionnairesQuestionPage($this->version, $response, $this->solution); } /** * Constructs a InsightsQuestionnairesQuestionContext * * @param string $questionSid The SID of the question */ public function getContext( string $questionSid ): InsightsQuestionnairesQuestionContext { return new InsightsQuestionnairesQuestionContext( $this->version, $questionSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentOptions.php000064400000003735150364341760021060 0ustar00options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.FetchInsightsSettingsCommentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InteractionContext.php000064400000007246150364341760016475 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelPage.php000064400000003035150364341760015444 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php000064400000004102150364341760017011 0ustar00solution = [ ]; $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 ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionOptions.php000064400000003663150364341760017360 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsOptions.php000064400000003757150364341760021560 0ustar00options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.FetchInsightsSettingsAnswerSetsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesInstance.php000064400000006224150364341760017765 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsOptions.php000064400000005312150364341760020563 0ustar00options['segmentId'] = $segmentId; $this->options['authorization'] = $authorization; } /** * Unique Id of the segment for which conversation details needs to be fetched * * @param string $segmentId Unique Id of the segment for which conversation details needs to be fetched * @return $this Fluent Builder */ public function setSegmentId(string $segmentId): self { $this->options['segmentId'] = $segmentId; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.ReadInsightsConversationsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsContext.php000064400000005366150364341760016527 0ustar00solution = [ 'assessmentSid' => $assessmentSid, ]; $this->uri = '/Insights/QualityManagement/Assessments/' . \rawurlencode($assessmentSid) .''; } /** * Update the AssessmentsInstance * * @param string $offset The offset of the conversation * @param string $answerText The answer text selected by user * @param string $answerId The id of the answer selected by user * @param array|Options $options Optional Arguments * @return AssessmentsInstance Updated AssessmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $offset, string $answerText, string $answerId, array $options = []): AssessmentsInstance { $options = new Values($options); $data = Values::of([ 'Offset' => $offset, 'AnswerText' => $answerText, 'AnswerId' => $answerId, ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new AssessmentsInstance( $this->version, $payload, $this->solution['assessmentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.AssessmentsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSessionList.php000064400000002565150364341760016640 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationList.php000064400000002551150364341760016306 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesOptions.php000064400000027616150364341760020752 0ustar00options['description'] = $description; $this->options['active'] = $active; $this->options['questionSids'] = $questionSids; $this->options['authorization'] = $authorization; } /** * The description of this questionnaire * * @param string $description The description of this questionnaire * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * The flag to enable or disable questionnaire * * @param bool $active The flag to enable or disable questionnaire * @return $this Fluent Builder */ public function setActive(bool $active): self { $this->options['active'] = $active; return $this; } /** * The list of questions sids under a questionnaire * * @param string[] $questionSids The list of questions sids under a questionnaire * @return $this Fluent Builder */ public function setQuestionSids(array $questionSids): self { $this->options['questionSids'] = $questionSids; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesOptions ' . $options . ']'; } } class DeleteInsightsQuestionnairesOptions extends Options { /** * @param string $authorization The Authorization HTTP request header */ public function __construct( string $authorization = Values::NONE ) { $this->options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesOptions ' . $options . ']'; } } class FetchInsightsQuestionnairesOptions extends Options { /** * @param string $authorization The Authorization HTTP request header */ public function __construct( string $authorization = Values::NONE ) { $this->options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.FetchInsightsQuestionnairesOptions ' . $options . ']'; } } class ReadInsightsQuestionnairesOptions extends Options { /** * @param bool $includeInactive Flag indicating whether to include inactive questionnaires or not * @param string $authorization The Authorization HTTP request header */ public function __construct( bool $includeInactive = Values::BOOL_NONE, string $authorization = Values::NONE ) { $this->options['includeInactive'] = $includeInactive; $this->options['authorization'] = $authorization; } /** * Flag indicating whether to include inactive questionnaires or not * * @param bool $includeInactive Flag indicating whether to include inactive questionnaires or not * @return $this Fluent Builder */ public function setIncludeInactive(bool $includeInactive): self { $this->options['includeInactive'] = $includeInactive; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesOptions ' . $options . ']'; } } class UpdateInsightsQuestionnairesOptions extends Options { /** * @param string $name The name of this questionnaire * @param string $description The description of this questionnaire * @param string[] $questionSids The list of questions sids under a questionnaire * @param string $authorization The Authorization HTTP request header */ public function __construct( string $name = Values::NONE, string $description = Values::NONE, array $questionSids = Values::ARRAY_NONE, string $authorization = Values::NONE ) { $this->options['name'] = $name; $this->options['description'] = $description; $this->options['questionSids'] = $questionSids; $this->options['authorization'] = $authorization; } /** * The name of this questionnaire * * @param string $name The name of this questionnaire * @return $this Fluent Builder */ public function setName(string $name): self { $this->options['name'] = $name; return $this; } /** * The description of this questionnaire * * @param string $description The description of this questionnaire * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * The list of questions sids under a questionnaire * * @param string[] $questionSids The list of questions sids under a questionnaire * @return $this Fluent Builder */ public function setQuestionSids(array $questionSids): self { $this->options['questionSids'] = $questionSids; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentOptions.php000064400000010640150364341760021561 0ustar00options['authorization'] = $authorization; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateInsightsAssessmentsCommentOptions ' . $options . ']'; } } class ReadInsightsAssessmentsCommentOptions extends Options { /** * @param string $segmentId The id of the segment. * @param string $agentId The id of the agent. * @param string $authorization The Authorization HTTP request header */ public function __construct( string $segmentId = Values::NONE, string $agentId = Values::NONE, string $authorization = Values::NONE ) { $this->options['segmentId'] = $segmentId; $this->options['agentId'] = $agentId; $this->options['authorization'] = $authorization; } /** * The id of the segment. * * @param string $segmentId The id of the segment. * @return $this Fluent Builder */ public function setSegmentId(string $segmentId): self { $this->options['segmentId'] = $segmentId; return $this; } /** * The id of the agent. * * @param string $agentId The id of the agent. * @return $this Fluent Builder */ public function setAgentId(string $agentId): self { $this->options['agentId'] = $agentId; return $this; } /** * The Authorization HTTP request header * * @param string $authorization The Authorization HTTP request header * @return $this Fluent Builder */ public function setAuthorization(string $authorization): self { $this->options['authorization'] = $authorization; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.ReadInsightsAssessmentsCommentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesInstance.php000064400000011475150364341760021057 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'questionnaireSid' => Values::array_get($payload, 'questionnaire_sid'), 'name' => Values::array_get($payload, 'name'), 'description' => Values::array_get($payload, 'description'), 'active' => Values::array_get($payload, 'active'), 'questions' => Values::array_get($payload, 'questions'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['questionnaireSid' => $questionnaireSid ?: $this->properties['questionnaireSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InsightsQuestionnairesContext Context for this InsightsQuestionnairesInstance */ protected function proxy(): InsightsQuestionnairesContext { if (!$this->context) { $this->context = new InsightsQuestionnairesContext( $this->version, $this->solution['questionnaireSid'] ); } return $this->context; } /** * Delete the InsightsQuestionnairesInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the InsightsQuestionnairesInstance * * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesInstance Fetched InsightsQuestionnairesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): InsightsQuestionnairesInstance { return $this->proxy()->fetch($options); } /** * Update the InsightsQuestionnairesInstance * * @param bool $active The flag to enable or disable questionnaire * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesInstance Updated InsightsQuestionnairesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $active, array $options = []): InsightsQuestionnairesInstance { return $this->proxy()->update($active, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InsightsQuestionnairesInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsList.php000064400000004006150364341760021024 0ustar00solution = [ ]; $this->uri = '/Insights/QualityManagement/Settings/AnswerSets'; } /** * Fetch the InsightsSettingsAnswerSetsInstance * * @param array|Options $options Optional Arguments * @return InsightsSettingsAnswerSetsInstance Fetched InsightsSettingsAnswerSetsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): InsightsSettingsAnswerSetsInstance { $options = new Values($options); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); return new InsightsSettingsAnswerSetsInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsSettingsAnswerSetsList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionPage.php000064400000003225150364341760021711 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelInstance.php000064400000010111150364341760015667 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'flexFlowSid' => Values::array_get($payload, 'flex_flow_sid'), 'sid' => Values::array_get($payload, 'sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'url' => Values::array_get($payload, 'url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryContext.php000064400000006144150364341760022432 0ustar00solution = [ 'categorySid' => $categorySid, ]; $this->uri = '/Insights/QualityManagement/Categories/' . \rawurlencode($categorySid) .''; } /** * Delete the InsightsQuestionnairesCategoryInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['Authorization' => $options['authorization']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Update the InsightsQuestionnairesCategoryInstance * * @param string $name The name of this category. * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesCategoryInstance Updated InsightsQuestionnairesCategoryInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $name, array $options = []): InsightsQuestionnairesCategoryInstance { $options = new Values($options); $data = Values::of([ 'Name' => $name, ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesCategoryInstance( $this->version, $payload, $this->solution['categorySid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php000064400000021755150364341760017146 0ustar00properties = [ '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'), 'agentConvEndMethods' => Values::array_get($payload, 'agent_conv_end_methods'), 'citrixVoiceVdi' => Values::array_get($payload, 'citrix_voice_vdi'), 'offlineConfig' => Values::array_get($payload, 'offline_config'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConfigurationContext Context for this ConfigurationInstance */ protected function proxy(): ConfigurationContext { if (!$this->context) { $this->context = new ConfigurationContext( $this->version ); } return $this->context; } /** * Fetch the ConfigurationInstance * * @param array|Options $options Optional Arguments * @return ConfigurationInstance Fetched ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): ConfigurationInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentInstance.php000064400000004331150364341760021162 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InteractionInstance.php000064400000007471150364341760016615 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'channel' => Values::array_get($payload, 'channel'), 'routing' => Values::array_get($payload, 'routing'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'interactionContextSid' => Values::array_get($payload, 'interaction_context_sid'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InteractionContext Context for this InteractionInstance */ protected function proxy(): InteractionContext { if (!$this->context) { $this->context = new InteractionContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the InteractionInstance * * @return InteractionInstance Fetched InteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InteractionInstance { return $this->proxy()->fetch(); } /** * Access the channels */ protected function getChannels(): InteractionChannelList { return $this->proxy()->channels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InteractionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentInstance.php000064400000006173150364341760021700 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assessmentSid' => Values::array_get($payload, 'assessment_sid'), 'comment' => Values::array_get($payload, 'comment'), 'offset' => Values::array_get($payload, 'offset'), 'report' => Values::array_get($payload, 'report'), 'weight' => Values::array_get($payload, 'weight'), 'agentId' => Values::array_get($payload, 'agent_id'), 'segmentId' => Values::array_get($payload, 'segment_id'), 'userName' => Values::array_get($payload, 'user_name'), 'userEmail' => Values::array_get($payload, 'user_email'), 'timestamp' => Values::array_get($payload, 'timestamp'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsAssessmentsCommentInstance]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InteractionList.php000064400000005046150364341760015760 0ustar00solution = [ ]; $this->uri = '/Interactions'; } /** * Create the InteractionInstance * * @param array $channel The Interaction's channel. * @param array $routing The Interaction's routing logic. * @param array|Options $options Optional Arguments * @return InteractionInstance Created InteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $channel, array $routing, array $options = []): InteractionInstance { $options = new Values($options); $data = Values::of([ 'Channel' => Serialize::jsonObject($channel), 'Routing' => Serialize::jsonObject($routing), 'InteractionContextSid' => $options['interactionContextSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InteractionInstance( $this->version, $payload ); } /** * Constructs a InteractionContext * * @param string $sid The SID of the Interaction resource to fetch. */ public function getContext( string $sid ): InteractionContext { return new InteractionContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InteractionList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryPage.php000064400000003225150364341760021657 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsUserRolesContext.php000064400000004122150364341760017640 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelOptions.php000064400000012762150364341760015574 0ustar00options['target'] = $target; $this->options['chatUniqueName'] = $chatUniqueName; $this->options['preEngagementData'] = $preEngagementData; $this->options['taskSid'] = $taskSid; $this->options['taskAttributes'] = $taskAttributes; $this->options['longLived'] = $longLived; } /** * The Target Contact Identity, for example the phone number of an SMS. * * @param string $target The Target Contact Identity, for example the phone number of an SMS. * @return $this Fluent Builder */ public function setTarget(string $target): self { $this->options['target'] = $target; return $this; } /** * The chat channel's unique name. * * @param string $chatUniqueName The chat channel's unique name. * @return $this Fluent Builder */ public function setChatUniqueName(string $chatUniqueName): self { $this->options['chatUniqueName'] = $chatUniqueName; return $this; } /** * The pre-engagement data. * * @param string $preEngagementData The pre-engagement data. * @return $this Fluent Builder */ public function setPreEngagementData(string $preEngagementData): self { $this->options['preEngagementData'] = $preEngagementData; return $this; } /** * The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external` * * @param string $taskSid The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external` * @return $this Fluent Builder */ public function setTaskSid(string $taskSid): self { $this->options['taskSid'] = $taskSid; return $this; } /** * The Task attributes to be added for the TaskRouter Task. * * @param string $taskAttributes The Task attributes to be added for the TaskRouter Task. * @return $this Fluent Builder */ public function setTaskAttributes(string $taskAttributes): self { $this->options['taskAttributes'] = $taskAttributes; return $this; } /** * Whether to create the channel as long-lived. * * @param bool $longLived Whether to create the channel as long-lived. * @return $this Fluent Builder */ public function setLongLived(bool $longLived): self { $this->options['longLived'] = $longLived; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FlexApi.V1.CreateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsList.php000064400000012574150364341760020053 0ustar00solution = [ ]; $this->uri = '/Insights/Conversations'; } /** * Reads InsightsConversationsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InsightsConversationsInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InsightsConversationsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InsightsConversationsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InsightsConversationsPage Page of InsightsConversationsInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InsightsConversationsPage { $options = new Values($options); $params = Values::of([ 'SegmentId' => $options['segmentId'], 'Authorization' => $options['authorization'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InsightsConversationsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InsightsConversationsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InsightsConversationsPage Page of InsightsConversationsInstance */ public function getPage(string $targetUrl): InsightsConversationsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InsightsConversationsPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsConversationsList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InteractionPage.php000064400000003043150364341760015714 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsList.php000064400000012665150364341760017004 0ustar00solution = [ ]; $this->uri = '/Insights/Segments'; } /** * Reads InsightsSegmentsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InsightsSegmentsInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InsightsSegmentsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InsightsSegmentsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InsightsSegmentsPage Page of InsightsSegmentsInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InsightsSegmentsPage { $options = new Values($options); $params = Values::of([ 'SegmentId' => $options['segmentId'], 'ReservationId' => Serialize::map($options['reservationId'], function ($e) { return $e; }), 'Authorization' => $options['authorization'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InsightsSegmentsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InsightsSegmentsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InsightsSegmentsPage Page of InsightsSegmentsInstance */ public function getPage(string $targetUrl): InsightsSegmentsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InsightsSegmentsPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsSegmentsList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowList.php000064400000017324150364341760015231 0ustar00solution = [ ]; $this->uri = '/FlexFlows'; } /** * Create the FlexFlowInstance * * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. * @param string $chatServiceSid The SID of the chat service. * @param string $channelType * @param array|Options $options Optional Arguments * @return FlexFlowInstance Created FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $chatServiceSid, string $channelType, array $options = []): FlexFlowInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'ChatServiceSid' => $chatServiceSid, 'ChannelType' => $channelType, 'ContactIdentity' => $options['contactIdentity'], 'Enabled' => Serialize::booleanToString($options['enabled']), 'IntegrationType' => $options['integrationType'], 'Integration.FlowSid' => $options['integrationFlowSid'], 'Integration.Url' => $options['integrationUrl'], 'Integration.WorkspaceSid' => $options['integrationWorkspaceSid'], 'Integration.WorkflowSid' => $options['integrationWorkflowSid'], 'Integration.Channel' => $options['integrationChannel'], 'Integration.Timeout' => $options['integrationTimeout'], 'Integration.Priority' => $options['integrationPriority'], 'Integration.CreationOnMessage' => Serialize::booleanToString($options['integrationCreationOnMessage']), 'LongLived' => Serialize::booleanToString($options['longLived']), 'JanitorEnabled' => Serialize::booleanToString($options['janitorEnabled']), 'Integration.RetryCount' => $options['integrationRetryCount'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FlexFlowInstance( $this->version, $payload ); } /** * Reads FlexFlowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlexFlowInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams FlexFlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FlexFlowInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FlexFlowPage Page of FlexFlowInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FlexFlowPage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FlexFlowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlexFlowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FlexFlowPage Page of FlexFlowInstance */ public function getPage(string $targetUrl): FlexFlowPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlexFlowPage($this->version, $response, $this->solution); } /** * Constructs a FlexFlowContext * * @param string $sid The SID of the Flex Flow resource to delete. */ public function getContext( string $sid ): FlexFlowContext { return new FlexFlowContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.FlexFlowList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsConversationsInstance.php000064400000004544150364341760020702 0ustar00properties = [ 'accountId' => Values::array_get($payload, 'account_id'), 'conversationId' => Values::array_get($payload, 'conversation_id'), 'segmentCount' => Values::array_get($payload, 'segment_count'), 'segments' => Values::array_get($payload, 'segments'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsConversationsInstance]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentList.php000064400000016043150364341760021044 0ustar00solution = [ ]; $this->uri = '/Insights/QualityManagement/Assessments/Comments'; } /** * Create the InsightsAssessmentsCommentInstance * * @param string $categoryId The ID of the category * @param string $categoryName The name of the category * @param string $comment The Assessment comment. * @param string $segmentId The id of the segment. * @param string $agentId The id of the agent. * @param string $offset The offset * @param array|Options $options Optional Arguments * @return InsightsAssessmentsCommentInstance Created InsightsAssessmentsCommentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $categoryId, string $categoryName, string $comment, string $segmentId, string $agentId, string $offset, array $options = []): InsightsAssessmentsCommentInstance { $options = new Values($options); $data = Values::of([ 'CategoryId' => $categoryId, 'CategoryName' => $categoryName, 'Comment' => $comment, 'SegmentId' => $segmentId, 'AgentId' => $agentId, 'Offset' => $offset, ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new InsightsAssessmentsCommentInstance( $this->version, $payload ); } /** * Reads InsightsAssessmentsCommentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InsightsAssessmentsCommentInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InsightsAssessmentsCommentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InsightsAssessmentsCommentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InsightsAssessmentsCommentPage Page of InsightsAssessmentsCommentInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InsightsAssessmentsCommentPage { $options = new Values($options); $params = Values::of([ 'SegmentId' => $options['segmentId'], 'AgentId' => $options['agentId'], 'Authorization' => $options['authorization'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InsightsAssessmentsCommentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InsightsAssessmentsCommentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InsightsAssessmentsCommentPage Page of InsightsAssessmentsCommentInstance */ public function getPage(string $targetUrl): InsightsAssessmentsCommentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InsightsAssessmentsCommentPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsAssessmentsCommentList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsSegmentsPage.php000064400000003101150364341760016726 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryList.php000064400000015015150364341760021716 0ustar00solution = [ ]; $this->uri = '/Insights/QualityManagement/Categories'; } /** * Create the InsightsQuestionnairesCategoryInstance * * @param string $name The name of this category. * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesCategoryInstance Created InsightsQuestionnairesCategoryInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $name, array $options = []): InsightsQuestionnairesCategoryInstance { $options = new Values($options); $data = Values::of([ 'Name' => $name, ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesCategoryInstance( $this->version, $payload ); } /** * Reads InsightsQuestionnairesCategoryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InsightsQuestionnairesCategoryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InsightsQuestionnairesCategoryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InsightsQuestionnairesCategoryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InsightsQuestionnairesCategoryPage Page of InsightsQuestionnairesCategoryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InsightsQuestionnairesCategoryPage { $params = Values::of([ 'Authorization' => $options['authorization'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InsightsQuestionnairesCategoryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InsightsQuestionnairesCategoryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InsightsQuestionnairesCategoryPage Page of InsightsQuestionnairesCategoryInstance */ public function getPage(string $targetUrl): InsightsQuestionnairesCategoryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InsightsQuestionnairesCategoryPage($this->version, $response, $this->solution); } /** * Constructs a InsightsQuestionnairesCategoryContext * * @param string $categorySid The SID of the category to be deleted */ public function getContext( string $categorySid ): InsightsQuestionnairesCategoryContext { return new InsightsQuestionnairesCategoryContext( $this->version, $categorySid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesContext.php000064400000010106150364341760020725 0ustar00solution = [ 'questionnaireSid' => $questionnaireSid, ]; $this->uri = '/Insights/QualityManagement/Questionnaires/' . \rawurlencode($questionnaireSid) .''; } /** * Delete the InsightsQuestionnairesInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['Authorization' => $options['authorization']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the InsightsQuestionnairesInstance * * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesInstance Fetched InsightsQuestionnairesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): InsightsQuestionnairesInstance { $options = new Values($options); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); return new InsightsQuestionnairesInstance( $this->version, $payload, $this->solution['questionnaireSid'] ); } /** * Update the InsightsQuestionnairesInstance * * @param bool $active The flag to enable or disable questionnaire * @param array|Options $options Optional Arguments * @return InsightsQuestionnairesInstance Updated InsightsQuestionnairesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $active, array $options = []): InsightsQuestionnairesInstance { $options = new Values($options); $data = Values::of([ 'Active' => Serialize::booleanToString($active), 'Name' => $options['name'], 'Description' => $options['description'], 'QuestionSids' => Serialize::map($options['questionSids'], function ($e) { return $e; }), ]); $headers = Values::of(['Authorization' => $options['authorization']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new InsightsQuestionnairesInstance( $this->version, $payload, $this->solution['questionnaireSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.InsightsQuestionnairesContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelContext.php000064400000004340150364341760015556 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/AssessmentsInstance.php000064400000011476150364341760016646 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assessmentSid' => Values::array_get($payload, 'assessment_sid'), 'offset' => Values::array_get($payload, 'offset'), 'report' => Values::array_get($payload, 'report'), 'weight' => Values::array_get($payload, 'weight'), 'agentId' => Values::array_get($payload, 'agent_id'), 'segmentId' => Values::array_get($payload, 'segment_id'), 'userName' => Values::array_get($payload, 'user_name'), 'userEmail' => Values::array_get($payload, 'user_email'), 'answerText' => Values::array_get($payload, 'answer_text'), 'answerId' => Values::array_get($payload, 'answer_id'), 'assessment' => Values::array_get($payload, 'assessment'), 'timestamp' => Values::array_get($payload, 'timestamp'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['assessmentSid' => $assessmentSid ?: $this->properties['assessmentSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssessmentsContext Context for this AssessmentsInstance */ protected function proxy(): AssessmentsContext { if (!$this->context) { $this->context = new AssessmentsContext( $this->version, $this->solution['assessmentSid'] ); } return $this->context; } /** * Update the AssessmentsInstance * * @param string $offset The offset of the conversation * @param string $answerText The answer text selected by user * @param string $answerId The id of the answer selected by user * @param array|Options $options Optional Arguments * @return AssessmentsInstance Updated AssessmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $offset, string $answerText, string $answerId, array $options = []): AssessmentsInstance { return $this->proxy()->update($offset, $answerText, $answerId, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.AssessmentsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowPage.php000064400000003021150364341760015157 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1.php000064400000007240150364341760012557 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Events/V1/SinkOptions.php000064400000005522150364341760015040 0ustar00options['inUse'] = $inUse; $this->options['status'] = $status; } /** * A boolean query parameter filtering the results to return sinks used/not used by a subscription. * * @param bool $inUse A boolean query parameter filtering the results to return sinks used/not used by a subscription. * @return $this Fluent Builder */ public function setInUse(bool $inUse): self { $this->options['inUse'] = $inUse; return $this; } /** * A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. * * @param string $status A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.ReadSinkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionOptions.php000064400000010424150364341760016615 0ustar00options['sinkSid'] = $sinkSid; } /** * The SID of the sink that the list of Subscriptions should be filtered by. * * @param string $sinkSid The SID of the sink that the list of Subscriptions should be filtered by. * @return $this Fluent Builder */ public function setSinkSid(string $sinkSid): self { $this->options['sinkSid'] = $sinkSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.ReadSubscriptionOptions ' . $options . ']'; } } class UpdateSubscriptionOptions extends Options { /** * @param string $description A human readable description for the Subscription. * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. */ public function __construct( string $description = Values::NONE, string $sinkSid = Values::NONE ) { $this->options['description'] = $description; $this->options['sinkSid'] = $sinkSid; } /** * A human readable description for the Subscription. * * @param string $description A human readable description for the Subscription. * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. * * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. * @return $this Fluent Builder */ public function setSinkSid(string $sinkSid): self { $this->options['sinkSid'] = $sinkSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.UpdateSubscriptionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateList.php000064400000004152150364341760016674 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Sinks/' . \rawurlencode($sid) .'/Validate'; } /** * Create the SinkValidateInstance * * @param string $testId A 34 character string that uniquely identifies the test event for a Sink being validated. * @return SinkValidateInstance Created SinkValidateInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $testId): SinkValidateInstance { $data = Values::of([ 'TestId' => $testId, ]); $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]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestPage.php000064400000003062150364341760016022 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateInstance.php000064400000004163150364341760017527 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestInstance.php000064400000004144150364341760016714 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php000064400000003505150364341760016063 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidatePage.php000064400000003112150364341760016630 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionInstance.php000064400000007370150364341760020216 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionPage.php000064400000003123150364341760017316 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionList.php000064400000012675150364341760017371 0ustar00solution = [ 'id' => $id, ]; $this->uri = '/Schemas/' . \rawurlencode($id) .'/Versions'; } /** * Reads SchemaVersionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SchemaVersionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SchemaVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SchemaVersionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SchemaVersionPage Page of SchemaVersionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SchemaVersionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SchemaVersionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SchemaVersionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SchemaVersionPage Page of SchemaVersionInstance */ public function getPage(string $targetUrl): SchemaVersionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SchemaVersionPage($this->version, $response, $this->solution); } /** * Constructs a SchemaVersionContext * * @param int $schemaVersion The version of the schema */ public function getContext( int $schemaVersion ): SchemaVersionContext { return new SchemaVersionContext( $this->version, $this->solution['id'], $schemaVersion ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SchemaVersionList]'; } } sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php000064400000004417150364341760020075 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SchemaPage.php000064400000003004150364341760014546 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1/SinkPage.php000064400000002770150364341760014263 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1/EventTypeInstance.php000064400000007350150364341760016171 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SinkList.php000064400000014646150364341760014327 0ustar00solution = [ ]; $this->uri = '/Sinks'; } /** * Create the SinkInstance * * @param string $description A human readable description for the Sink **This value should not contain PII.** * @param array $sinkConfiguration The information required for Twilio to connect to the provided Sink encoded as JSON. * @param string $sinkType * @return SinkInstance Created SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $description, array $sinkConfiguration, string $sinkType): SinkInstance { $data = Values::of([ 'Description' => $description, 'SinkConfiguration' => Serialize::jsonObject($sinkConfiguration), 'SinkType' => $sinkType, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SinkInstance( $this->version, $payload ); } /** * Reads SinkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SinkInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SinkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SinkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SinkPage Page of SinkInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SinkPage { $options = new Values($options); $params = Values::of([ 'InUse' => Serialize::booleanToString($options['inUse']), 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SinkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SinkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SinkPage Page of SinkInstance */ public function getPage(string $targetUrl): SinkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SinkPage($this->version, $response, $this->solution); } /** * Constructs a SinkContext * * @param string $sid A 34 character string that uniquely identifies this Sink. */ public function getContext( string $sid ): SinkContext { return new SinkContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkList]'; } } sdk/src/Twilio/Rest/Events/V1/EventTypePage.php000064400000003026150364341760015275 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionInstance.php000064400000011444150364341760016731 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'description' => Values::array_get($payload, 'description'), 'sinkSid' => Values::array_get($payload, 'sink_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SubscriptionContext Context for this SubscriptionInstance */ protected function proxy(): SubscriptionContext { if (!$this->context) { $this->context = new SubscriptionContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SubscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SubscriptionInstance * * @return SubscriptionInstance Fetched SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscriptionInstance { return $this->proxy()->fetch(); } /** * Update the SubscriptionInstance * * @param array|Options $options Optional Arguments * @return SubscriptionInstance Updated SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SubscriptionInstance { return $this->proxy()->update($options); } /** * Access the subscribedEvents */ protected function getSubscribedEvents(): SubscribedEventList { return $this->proxy()->subscribedEvents; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SubscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionContext.php000064400000011462150364341760016611 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Subscriptions/' . \rawurlencode($sid) .''; } /** * Delete the SubscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SchemaList.php000064400000002750150364341760014614 0ustar00solution = [ ]; } /** * Constructs a SchemaContext * * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. */ public function getContext( string $id ): SchemaContext { return new SchemaContext( $this->version, $id ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SchemaList]'; } } sdk/src/Twilio/Rest/Events/V1/EventTypeContext.php000064400000003722150364341760016050 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SchemaContext.php000064400000007216150364341760015327 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SchemaInstance.php000064400000007413150364341760015446 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionList.php000064400000015223150364341760016077 0ustar00solution = [ ]; $this->uri = '/Subscriptions'; } /** * Create the SubscriptionInstance * * @param string $description A human readable description for the Subscription **This value should not contain PII.** * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. * @param array[] $types An array of objects containing the subscribed Event Types * @return SubscriptionInstance Created SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $description, string $sinkSid, array $types): SubscriptionInstance { $data = Values::of([ 'Description' => $description, 'SinkSid' => $sinkSid, 'Types' => Serialize::map($types,function ($e) { return Serialize::jsonObject($e); }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SubscriptionInstance( $this->version, $payload ); } /** * Reads SubscriptionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SubscriptionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SubscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SubscriptionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SubscriptionPage Page of SubscriptionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SubscriptionPage { $options = new Values($options); $params = Values::of([ 'SinkSid' => $options['sinkSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SubscriptionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SubscriptionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SubscriptionPage Page of SubscriptionInstance */ public function getPage(string $targetUrl): SubscriptionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SubscriptionPage($this->version, $response, $this->solution); } /** * Constructs a SubscriptionContext * * @param string $sid A 34 character string that uniquely identifies this Subscription. */ public function getContext( string $sid ): SubscriptionContext { return new SubscriptionContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SubscriptionList]'; } } sdk/src/Twilio/Rest/Events/V1/SinkContext.php000064400000011573150364341760015034 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Sinks/' . \rawurlencode($sid) .''; } /** * Delete the SinkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the SinkInstance * * @param string $description A human readable description for the Sink **This value should not contain PII.** * @return SinkInstance Updated SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $description): SinkInstance { $data = Values::of([ 'Description' => $description, ]); $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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SinkInstance.php000064400000011761150364341760015153 0ustar00properties = [ 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'description' => Values::array_get($payload, 'description'), 'sid' => Values::array_get($payload, 'sid'), 'sinkConfiguration' => Values::array_get($payload, 'sink_configuration'), 'sinkType' => Values::array_get($payload, 'sink_type'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SinkContext Context for this SinkInstance */ protected function proxy(): SinkContext { if (!$this->context) { $this->context = new SinkContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SinkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SinkInstance * * @return SinkInstance Fetched SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SinkInstance { return $this->proxy()->fetch(); } /** * Update the SinkInstance * * @param string $description A human readable description for the Sink **This value should not contain PII.** * @return SinkInstance Updated SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $description): SinkInstance { return $this->proxy()->update($description); } /** * Access the sinkTest */ protected function getSinkTest(): SinkTestList { return $this->proxy()->sinkTest; } /** * Access the sinkValidate */ protected function getSinkValidate(): SinkValidateList { return $this->proxy()->sinkValidate; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SinkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionPage.php000064400000003050150364341760016033 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.php000064400000006563150364341760021715 0ustar00options['schemaVersion'] = $schemaVersion; } /** * The schema version that the subscription should use. * * @param int $schemaVersion The schema version that the subscription should use. * @return $this Fluent Builder */ public function setSchemaVersion(int $schemaVersion): self { $this->options['schemaVersion'] = $schemaVersion; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.CreateSubscribedEventOptions ' . $options . ']'; } } class UpdateSubscribedEventOptions extends Options { /** * @param int $schemaVersion The schema version that the subscription should use. */ public function __construct( int $schemaVersion = Values::INT_NONE ) { $this->options['schemaVersion'] = $schemaVersion; } /** * The schema version that the subscription should use. * * @param int $schemaVersion The schema version that the subscription should use. * @return $this Fluent Builder */ public function setSchemaVersion(int $schemaVersion): self { $this->options['schemaVersion'] = $schemaVersion; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.UpdateSubscribedEventOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php000064400000006547150364341760021710 0ustar00solution = [ 'subscriptionSid' => $subscriptionSid, 'type' => $type, ]; $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) .'/SubscribedEvents/' . \rawurlencode($type) .''; } /** * Delete the SubscribedEventInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventPage.php000064400000003170150364341760021125 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventList.php000064400000014612150364341760021167 0ustar00solution = [ 'subscriptionSid' => $subscriptionSid, ]; $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) .'/SubscribedEvents'; } /** * Create the SubscribedEventInstance * * @param string $type Type of event being subscribed to. * @param array|Options $options Optional Arguments * @return SubscribedEventInstance Created SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): SubscribedEventInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'SchemaVersion' => $options['schemaVersion'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SubscribedEventInstance( $this->version, $payload, $this->solution['subscriptionSid'] ); } /** * Reads SubscribedEventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SubscribedEventInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SubscribedEventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SubscribedEventInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SubscribedEventPage Page of SubscribedEventInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SubscribedEventPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SubscribedEventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SubscribedEventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SubscribedEventPage Page of SubscribedEventInstance */ public function getPage(string $targetUrl): SubscribedEventPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SubscribedEventPage($this->version, $response, $this->solution); } /** * Constructs a SubscribedEventContext * * @param string $type Type of event being subscribed to. */ public function getContext( string $type ): SubscribedEventContext { return new SubscribedEventContext( $this->version, $this->solution['subscriptionSid'], $type ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SubscribedEventList]'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventInstance.php000064400000010626150364341760022021 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'type' => Values::array_get($payload, 'type'), 'schemaVersion' => Values::array_get($payload, 'schema_version'), 'subscriptionSid' => Values::array_get($payload, 'subscription_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['subscriptionSid' => $subscriptionSid, 'type' => $type ?: $this->properties['type'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SubscribedEventContext Context for this SubscribedEventInstance */ protected function proxy(): SubscribedEventContext { if (!$this->context) { $this->context = new SubscribedEventContext( $this->version, $this->solution['subscriptionSid'], $this->solution['type'] ); } return $this->context; } /** * Delete the SubscribedEventInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SubscribedEventInstance * * @return SubscribedEventInstance Fetched SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscribedEventInstance { return $this->proxy()->fetch(); } /** * Update the SubscribedEventInstance * * @param array|Options $options Optional Arguments * @return SubscribedEventInstance Updated SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SubscribedEventInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SubscribedEventInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/EventTypeOptions.php000064400000004051150364341760016053 0ustar00options['schemaId'] = $schemaId; } /** * A string parameter filtering the results to return only the Event Types using a given schema. * * @param string $schemaId A string parameter filtering the results to return only the Event Types using a given schema. * @return $this Fluent Builder */ public function setSchemaId(string $schemaId): self { $this->options['schemaId'] = $schemaId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.ReadEventTypeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Events/V1/EventTypeList.php000064400000012652150364341760015341 0ustar00solution = [ ]; $this->uri = '/Types'; } /** * Reads EventTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventTypeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams EventTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EventTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EventTypePage Page of EventTypeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EventTypePage { $options = new Values($options); $params = Values::of([ 'SchemaId' => $options['schemaId'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EventTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EventTypePage Page of EventTypeInstance */ public function getPage(string $targetUrl): EventTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventTypePage($this->version, $response, $this->solution); } /** * Constructs a EventTypeContext * * @param string $type A string that uniquely identifies this Event Type. */ public function getContext( string $type ): EventTypeContext { return new EventTypeContext( $this->version, $type ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.EventTypeList]'; } } sdk/src/Twilio/Rest/MessagingBase.php000064400000004547150364341760013544 0ustar00baseUrl = 'https://messaging.twilio.com'; } /** * @return V1 Version v1 of messaging */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging]'; } } sdk/src/Twilio/Rest/ServerlessBase.php000064400000004556150364341760013764 0ustar00baseUrl = 'https://serverless.twilio.com'; } /** * @return V1 Version v1 of serverless */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless]'; } } sdk/src/Twilio/Rest/Insights.php000064400000005175150364341760012622 0ustar00settings instead. */ protected function getSettings(): \Twilio\Rest\Insights\V1\SettingList { echo "settings is deprecated. Use v1->settings instead."; return $this->v1->settings; } /** * @deprecated Use v1->settings() instead. */ protected function contextSettings(): \Twilio\Rest\Insights\V1\SettingContext { echo "settings() is deprecated. Use v1->settings() instead."; return $this->v1->settings(); } /** * @deprecated Use v1->calls instead. */ protected function getCalls(): \Twilio\Rest\Insights\V1\CallList { echo "calls is deprecated. Use v1->calls instead."; return $this->v1->calls; } /** * @deprecated Use v1->calls(\$sid) instead. * @param string $sid The sid */ protected function contextCalls(string $sid): \Twilio\Rest\Insights\V1\CallContext { echo "calls(\$sid) is deprecated. Use v1->calls(\$sid) instead."; return $this->v1->calls($sid); } /** * @deprecated Use v1->callSummaries instead. */ protected function getCallSummaries(): \Twilio\Rest\Insights\V1\CallSummariesList { echo "callSummaries is deprecated. Use v1->callSummaries instead."; return $this->v1->callSummaries; } /** * @deprecated Use v1->conferences instead. */ protected function getConferences(): \Twilio\Rest\Insights\V1\ConferenceList { echo "conferences is deprecated. Use v1->conferences instead."; return $this->v1->conferences; } /** * @deprecated Use v1->conferences(\$conferenceSid) instead. * @param string $conferenceSid Conference SID. */ protected function contextConferences(string $conferenceSid): \Twilio\Rest\Insights\V1\ConferenceContext { echo "conferences(\$conferenceSid) is deprecated. Use v1->conferences(\$conferenceSid) instead."; return $this->v1->conferences($conferenceSid); } /** * @deprecated Use v1->rooms instead. */ protected function getRooms(): \Twilio\Rest\Insights\V1\RoomList { echo "rooms is deprecated. Use v1->rooms instead."; return $this->v1->rooms; } /** * @deprecated Use v1->rooms(\$roomSid) instead. * @param string $roomSid The SID of the Room resource. */ protected function contextRooms(string $roomSid): \Twilio\Rest\Insights\V1\RoomContext { echo "rooms(\$roomSid) is deprecated. Use v1->rooms(\$roomSid) instead."; return $this->v1->rooms($roomSid); } }sdk/src/Twilio/Rest/Autopilot/V1.php000064400000005734150364341760013301 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantContext.php000064400000021374150364341760016615 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($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); } /** * 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'] ); } /** * Access the fieldTypes */ protected function getFieldTypes(): FieldTypeList { if (!$this->_fieldTypes) { $this->_fieldTypes = new FieldTypeList( $this->version, $this->solution['sid'] ); } return $this->_fieldTypes; } /** * 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 webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the tasks */ protected function getTasks(): TaskList { if (!$this->_tasks) { $this->_tasks = new TaskList( $this->version, $this->solution['sid'] ); } return $this->_tasks; } /** * Access the defaults */ protected function getDefaults(): DefaultsList { if (!$this->_defaults) { $this->_defaults = new DefaultsList( $this->version, $this->solution['sid'] ); } return $this->_defaults; } /** * Access the styleSheet */ protected function getStyleSheet(): StyleSheetList { if (!$this->_styleSheet) { $this->_styleSheet = new StyleSheetList( $this->version, $this->solution['sid'] ); } return $this->_styleSheet; } /** * Access the dialogues */ protected function getDialogues(): DialogueList { if (!$this->_dialogues) { $this->_dialogues = new DialogueList( $this->version, $this->solution['sid'] ); } return $this->_dialogues; } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/RestoreAssistantList.php000064400000003660150364341760017446 0ustar00solution = [ ]; $this->uri = '/Assistants/Restore'; } /** * Update the RestoreAssistantInstance * * @param string $assistant The Twilio-provided string that uniquely identifies the Assistant resource to restore. * @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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantPage.php000064400000003042150364341760016035 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantList.php000064400000014514150364341760016102 0ustar00solution = [ ]; $this->uri = '/Assistants'; } /** * 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 ); } /** * 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); } /** * 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']); } /** * 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); } /** * Constructs a AssistantContext * * @param string $sid The Twilio-provided string that uniquely identifies the Assistant resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/RestoreAssistantInstance.php000064400000006514150364341760020300 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/RestoreAssistantPage.php000064400000003114150364341760017401 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantInstance.php000064400000016007150364341760016732 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * Access the fieldTypes */ protected function getFieldTypes(): FieldTypeList { return $this->proxy()->fieldTypes; } /** * Access the modelBuilds */ protected function getModelBuilds(): ModelBuildList { return $this->proxy()->modelBuilds; } /** * Access the queries */ protected function getQueries(): QueryList { return $this->proxy()->queries; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the tasks */ protected function getTasks(): TaskList { return $this->proxy()->tasks; } /** * Access the defaults */ protected function getDefaults(): DefaultsList { return $this->proxy()->defaults; } /** * Access the styleSheet */ protected function getStyleSheet(): StyleSheetList { return $this->proxy()->styleSheet; } /** * Access the dialogues */ protected function getDialogues(): DialogueList { return $this->proxy()->dialogues; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildOptions.php000064400000012740150364341760020641 0ustar00options['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. 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. * @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. 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. */ 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. 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. * @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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsList.php000064400000003207150364341760017646 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookList.php000064400000015465150364341760017506 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $uniqueName 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 $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'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid The Twilio-provided string that uniquely identifies the Webhook resource to delete. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['assistantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryContext.php000064400000006545150364341760017725 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Queries/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookOptions.php000064400000013725150364341760020223 0ustar00options['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 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 $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 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. * @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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeOptions.php000064400000012071150364341760020503 0ustar00options['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 descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Autopilot.V1.CreateFieldTypeOptions ' . $options . ']'; } } class UpdateFieldTypeOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. */ 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 descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An 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. 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. * @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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueList.php000064400000003442150364341760017631 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; } /** * Constructs a DialogueContext * * @param string $sid The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetOptions.php000064400000003720150364341760020710 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookContext.php000064400000007024150364341760020207 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskPage.php000064400000003071150364341760016741 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueInstance.php000064400000007353150364341760020467 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetList.php000064400000003223150364341760020166 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskList.php000064400000015132150364341760017001 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks'; } /** * Create the TaskInstance * * @param string $uniqueName 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 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'] ); } /** * 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); } /** * 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']); } /** * 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); } /** * Constructs a TaskContext * * @param string $sid The Twilio-provided string that uniquely identifies the Task resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskInstance.php000064400000013525150364341760017636 0ustar00properties = [ '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; } /** * 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(); } /** * Fetch the TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskInstance { return $this->proxy()->fetch(); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskInstance { return $this->proxy()->update($options); } /** * Access the samples */ protected function getSamples(): SampleList { return $this->proxy()->samples; } /** * Access the fields */ protected function getFields(): FieldList { return $this->proxy()->fields; } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetPage.php000064400000003135150364341760020131 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryInstance.php000064400000012530150364341760020034 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypePage.php000064400000003127150364341760017726 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsInstance.php000064400000007471150364341760020506 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueInstance.php000064400000011556150364341760022643 0ustar00properties = [ '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; } /** * 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(); } /** * Fetch the FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldValueInstance { 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.FieldValueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValuePage.php000064400000003222150364341760021742 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueList.php000064400000016442150364341760022011 0ustar00solution = [ 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/FieldTypes/' . \rawurlencode($fieldTypeSid) .'/FieldValues'; } /** * Create the FieldValueInstance * * @param string $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 $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'] ); } /** * 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); } /** * 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']); } /** * Retrieve a single page of FieldValueInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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); } /** * Constructs a FieldValueContext * * @param string $sid The Twilio-provided string that uniquely identifies the FieldValue resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueContext.php000064400000005664150364341760022526 0ustar00solution = [ 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/FieldTypes/' . \rawurlencode($fieldTypeSid) .'/FieldValues/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueOptions.php000064400000007465150364341760022536 0ustar00options['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 . ']'; } } class ReadFieldValueOptions extends Options { /** * @param string $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` */ 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](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` * @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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookInstance.php000064400000011736150364341760020334 0ustar00properties = [ '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; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildList.php000064400000014502150364341760020117 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/ModelBuilds'; } /** * 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'] ); } /** * 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); } /** * 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']); } /** * 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); } /** * Constructs a ModelBuildContext * * @param string $sid The Twilio-provided string that uniquely identifies the ModelBuild resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildPage.php000064400000003135150364341760020060 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryList.php000064400000016150150364341760017205 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Queries'; } /** * Create the QueryInstance * * @param string $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 new query. For example: `en-US`. * @param string $query The end-user's natural language input. 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'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * 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); } /** * 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']); } /** * Retrieve a single page of QueryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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); } /** * Constructs a QueryContext * * @param string $sid The Twilio-provided string that uniquely identifies the Query resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskOptions.php000064400000021126150364341760017521 0ustar00options['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 A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The 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](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. * @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 descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $uniqueName 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 array $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 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 descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An 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. 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. * @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](https://www.twilio.com/docs/autopilot/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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DialoguePage.php000064400000003121150364341760017564 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsPage.php000064400000003121150364341760017602 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsOptions.php000064400000004270150364341760020367 0ustar00options['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 for the `assistant_initiation`, `collect`, and `fallback` situations. * @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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildContext.php000064400000006572150364341760020640 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/ModelBuilds/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldList.php000064400000015622150364341760020030 0ustar00solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Fields'; } /** * Create the FieldInstance * * @param string $fieldType The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. * @param string $uniqueName 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. * @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'] ); } /** * 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); } /** * 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']); } /** * 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); } /** * Constructs a FieldContext * * @param string $sid The Twilio-provided string that uniquely identifies the Field resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsOptions.php000064400000004453150364341760021750 0ustar00options['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](https://www.twilio.com/docs/autopilot/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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsContext.php000064400000004701150364341760022467 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleOptions.php000064400000020175150364341760020745 0ustar00options['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. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. * @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 ReadSampleOptions extends Options { /** * @param string $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`. */ 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](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`. * @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 UpdateSampleOptions extends Options { /** * @param string $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 $taggedText 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 $sourceChannel The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. */ 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](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`. * @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. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). * @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. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. * @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 . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsInstance.php000064400000007725150364341760022620 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsList.php000064400000003670150364341760021762 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsPage.php000064400000003211150364341760021160 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsContext.php000064400000006371150364341760021742 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsPage.php000064400000003233150364341760021716 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleList.php000064400000016564150364341760020234 0ustar00solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Samples'; } /** * Create the SampleInstance * * @param string $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 new sample. For example: `en-US`. * @param string $taggedText 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 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'] ); } /** * 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); } /** * 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']); } /** * Retrieve a single page of SampleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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); } /** * Constructs a SampleContext * * @param string $sid The Twilio-provided string that uniquely identifies the Sample resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldInstance.php000064400000011340150364341760020652 0ustar00properties = [ '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; } /** * 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(); } /** * Fetch the FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldInstance { 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.FieldInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleInstance.php000064400000012317150364341760021055 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleContext.php000064400000007457150364341760020746 0ustar00solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Samples/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SamplePage.php000064400000003153150364341760020163 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldContext.php000064400000005614150364341760020541 0ustar00solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Fields/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsList.php000064400000003715150364341760021230 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsInstance.php000064400000010335150364341760022055 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldPage.php000064400000003145150364341760017766 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetContext.php000064400000005574150364341760020712 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueContext.php000064400000004514150364341760020343 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeInstance.php000064400000012212150364341760020611 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookPage.php000064400000003113150364341760017432 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryPage.php000064400000003077150364341760017152 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeList.php000064400000015026150364341760017766 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/FieldTypes'; } /** * Create the FieldTypeInstance * * @param string $uniqueName 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 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'] ); } /** * 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); } /** * 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']); } /** * 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); } /** * Constructs a FieldTypeContext * * @param string $sid The Twilio-provided string that uniquely identifies the FieldType resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetInstance.php000064400000007527150364341760021032 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryOptions.php000064400000024221150364341760017723 0ustar00options['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. 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. * @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](https://www.twilio.com/docs/autopilot/api/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 ReadQueryOptions extends Options { /** * @param string $language 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 $modelBuild The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. * @param string $status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` * @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](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`. * @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](https://www.twilio.com/docs/autopilot/api/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. Can be: `pending-review`, `reviewed`, or `discarded` * @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 UpdateQueryOptions extends Options { /** * @param string $sampleSid The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. * @param string $status The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` */ 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](https://www.twilio.com/docs/autopilot/api/task-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. Can be: `pending-review`, `reviewed`, or `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.Autopilot.V1.UpdateQueryOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildInstance.php000064400000012003150364341760020742 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskContext.php000064400000015666150364341760017526 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($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); } /** * 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'] ); } /** * 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 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 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsContext.php000064400000005534150364341760020364 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeContext.php000064400000012257150364341760020502 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/FieldTypes/' . \rawurlencode($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); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantOptions.php000064400000037727150364341760016635 0ustar00options['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 descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * 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. 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. * @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. 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. * @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 The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) * @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, including initiation actions and fallback tasks. * @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 descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param bool $logQueries 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 string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. * @param string $callbackUrl Reserved. * @param string $callbackEvents Reserved. * @param array $styleSheet The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) * @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, including initiation actions and fallback tasks. * @param string $developmentStage A string describing the state of the assistant. */ public function __construct( string $friendlyName = Values::NONE, bool $logQueries = Values::BOOL_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 descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * 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. 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. * @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. 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. * @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 The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) * @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, including initiation actions and fallback tasks. * @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 . ']'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberPage.php000064400000003042150364341760015610 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkList.php000064400000002703150364341760014533 0ustar00solution = [ ]; } /** * Constructs a TrunkContext * * @param string $sipTrunkDomain The absolute URL of the SIP Trunk */ public function getContext( string $sipTrunkDomain ): TrunkContext { return new TrunkContext( $this->version, $sipTrunkDomain ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.TrunkList]'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainPage.php000064400000003026150364341760015253 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberInstance.php000064400000010447150364341760016507 0ustar00properties = [ 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'url' => Values::array_get($payload, 'url'), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'voiceRegion' => Values::array_get($payload, 'voice_region'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { return $this->proxy()->fetch(); } /** * Update the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Updated PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): PhoneNumberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkPage.php000064400000002776150364341760014506 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainList.php000064400000002653150364341760015317 0ustar00solution = [ ]; } /** * Constructs a SipDomainContext * * @param string $sipDomain */ public function getContext( string $sipDomain ): SipDomainContext { return new SipDomainContext( $this->version, $sipDomain ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.SipDomainList]'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainOptions.php000064400000004334150364341760016035 0ustar00options['voiceRegion'] = $voiceRegion; $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $voiceRegion * @return $this Fluent Builder */ public function setVoiceRegion(string $voiceRegion): self { $this->options['voiceRegion'] = $voiceRegion; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Routes.V2.UpdateSipDomainOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkContext.php000064400000005351150364341760015246 0ustar00solution = [ 'sipTrunkDomain' => $sipTrunkDomain, ]; $this->uri = '/Trunks/' . \rawurlencode($sipTrunkDomain) .''; } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { $payload = $this->version->fetch('GET', $this->uri); return new TrunkInstance( $this->version, $payload, $this->solution['sipTrunkDomain'] ); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrunkInstance { $options = new Values($options); $data = Values::of([ 'VoiceRegion' => $options['voiceRegion'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php000064400000005447150364341760016373 0ustar00solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) .''; } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri); return new PhoneNumberInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Update the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Updated PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): PhoneNumberInstance { $options = new Values($options); $data = Values::of([ 'VoiceRegion' => $options['voiceRegion'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberList.php000064400000002735150364341760015657 0ustar00solution = [ ]; } /** * Constructs a PhoneNumberContext * * @param string $phoneNumber The phone number in E.164 format */ public function getContext( string $phoneNumber ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberOptions.php000064400000005374150364341760016401 0ustar00options['voiceRegion'] = $voiceRegion; $this->options['friendlyName'] = $friendlyName; } /** * The Inbound Processing Region used for this phone number for voice * * @param string $voiceRegion The Inbound Processing Region used for this phone number for voice * @return $this Fluent Builder */ public function setVoiceRegion(string $voiceRegion): self { $this->options['voiceRegion'] = $voiceRegion; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Routes.V2.UpdatePhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainContext.php000064400000005335150364341760016030 0ustar00solution = [ 'sipDomain' => $sipDomain, ]; $this->uri = '/SipDomains/' . \rawurlencode($sipDomain) .''; } /** * Fetch the SipDomainInstance * * @return SipDomainInstance Fetched SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SipDomainInstance { $payload = $this->version->fetch('GET', $this->uri); return new SipDomainInstance( $this->version, $payload, $this->solution['sipDomain'] ); } /** * Update the SipDomainInstance * * @param array|Options $options Optional Arguments * @return SipDomainInstance Updated SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SipDomainInstance { $options = new Values($options); $data = Values::of([ 'VoiceRegion' => $options['voiceRegion'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkInstance.php000064400000010352150364341760015363 0ustar00properties = [ 'sipTrunkDomain' => Values::array_get($payload, 'sip_trunk_domain'), 'url' => Values::array_get($payload, 'url'), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'voiceRegion' => Values::array_get($payload, 'voice_region'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['sipTrunkDomain' => $sipTrunkDomain ?: $this->properties['sipTrunkDomain'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrunkContext Context for this TrunkInstance */ protected function proxy(): TrunkContext { if (!$this->context) { $this->context = new TrunkContext( $this->version, $this->solution['sipTrunkDomain'] ); } return $this->context; } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { return $this->proxy()->fetch(); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrunkInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.TrunkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkOptions.php000064400000005314150364341760015254 0ustar00options['voiceRegion'] = $voiceRegion; $this->options['friendlyName'] = $friendlyName; } /** * The Inbound Processing Region used for this SIP Trunk for voice * * @param string $voiceRegion The Inbound Processing Region used for this SIP Trunk for voice * @return $this Fluent Builder */ public function setVoiceRegion(string $voiceRegion): self { $this->options['voiceRegion'] = $voiceRegion; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Routes.V2.UpdateTrunkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainInstance.php000064400000010327150364341760016145 0ustar00properties = [ 'sipDomain' => Values::array_get($payload, 'sip_domain'), 'url' => Values::array_get($payload, 'url'), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'voiceRegion' => Values::array_get($payload, 'voice_region'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['sipDomain' => $sipDomain ?: $this->properties['sipDomain'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SipDomainContext Context for this SipDomainInstance */ protected function proxy(): SipDomainContext { if (!$this->context) { $this->context = new SipDomainContext( $this->version, $this->solution['sipDomain'] ); } return $this->context; } /** * Fetch the SipDomainInstance * * @return SipDomainInstance Fetched SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SipDomainInstance { return $this->proxy()->fetch(); } /** * Update the SipDomainInstance * * @param array|Options $options Optional Arguments * @return SipDomainInstance Updated SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SipDomainInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.SipDomainInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2.php000064400000006530150364341760012576 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Accounts.php000064400000003131150364341760012577 0ustar00authTokenPromotion instead */ protected function getAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionList { echo "authTokenPromotion is deprecated. Use v1->authTokenPromotion instead."; return $this->v1->authTokenPromotion; } /** * @deprecated Use v1->authTokenPromotion() instead. */ protected function contextAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionContext { echo "authTokenPromotion() is deprecated. Use v1->authTokenPromotion() instead."; return $this->v1->authTokenPromotion(); } /** * @deprecated Use v1->credentials instead. */ protected function getCredentials(): \Twilio\Rest\Accounts\V1\CredentialList { echo "credentials is deprecated. Use v1->credentials instead."; return $this->v1->credentials; } /** * @deprecated Use v1->secondaryAuthToken instead. */ protected function getSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenList { echo "secondaryAuthToken is deprecated. Use v1->secondaryAuthToken instead."; return $this->v1->secondaryAuthToken; } /** * @deprecated Use v1->secondaryAuthToken() instead. */ protected function contextSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenContext { echo "secondaryAuthToken() is deprecated. Use v1->secondaryAuthToken() instead."; return $this->v1->secondaryAuthToken(); } }sdk/src/Twilio/Rest/Pricing.php000064400000004416150364341760012422 0ustar00messaging instead. */ protected function getMessaging(): \Twilio\Rest\Pricing\V1\MessagingList { echo "messaging is deprecated. Use v1->messaging instead."; return $this->v1->messaging; } /** * @deprecated Use v1->phoneNumbers instead. */ protected function getPhoneNumbers(): \Twilio\Rest\Pricing\V1\PhoneNumberList { echo "phoneNumbers is deprecated. Use v1->phoneNumbers instead."; return $this->v1->phoneNumbers; } /** * @deprecated Use v2->voice instead. */ protected function getVoice(): \Twilio\Rest\Pricing\V2\VoiceList { echo "voice is deprecated. Use v2->voice instead."; return $this->v2->voice; } /** * @deprecated Use v2->countries instead. */ protected function getCountries(): \Twilio\Rest\Pricing\V2\CountryList { echo "countries is deprecated. Use v2->countries instead."; return $this->v2->countries; } /** * @deprecated Use v2->countries(\$isoCountry) instead. * @param string $isoCountry The ISO country code of the pricing information to * fetch */ protected function contextCountries(string $isoCountry): \Twilio\Rest\Pricing\V2\CountryContext { echo "countries(\$isoCountry) is deprecated. Use v2->countries(\$isoCountry) instead."; return $this->v2->countries($isoCountry); } /** * @deprecated Use v2->numbers instead. */ protected function getNumbers(): \Twilio\Rest\Pricing\V2\NumberList { echo "numbers is deprecated. Use v2->numbers instead."; return $this->v2->numbers; } /** * @deprecated Use v2->numbers(\$destinationNumber) instead. * @param string $destinationNumber The destination number for which to fetch * pricing information */ protected function contextNumbers(string $destinationNumber): \Twilio\Rest\Pricing\V2\NumberContext { echo "numbers(\$destinationNumber) is deprecated. Use v2->numbers(\$destinationNumber) instead."; return $this->v2->numbers($destinationNumber); } }sdk/src/Twilio/Rest/IpMessaging/V1.php000064400000005757150364341760013534 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php000064400000011073150364341760017507 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php000064400000013257150364341760017412 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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 userBindings */ protected function getUserBindings(): UserBindingList { if (!$this->_userBindings) { $this->_userBindings = new UserBindingList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userBindings; } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleList.php000064400000014071150364341760016657 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName * @param string $type * @param string[] $permission * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.RoleList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php000064400000004612150364341760020041 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php000064400000014340150364341760017413 0ustar00options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid * @param string $attributes * @param string $friendlyName * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserPage.php000064400000003074150364341760016636 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php000064400000015514150364341760017331 0ustar00solution = [ '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'] ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.ChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php000064400000003116150364341760017265 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php000064400000013207150364341760017525 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userBindings */ protected function getUserBindings(): UserBindingList { return $this->proxy()->userBindings; } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php000064400000006054150364341760017372 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php000064400000004306150364341760020050 0ustar00options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * * * @param string $bindingType * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php000064400000014217150364341760020161 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php000064400000011141150364341760020154 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BindingContext Context for this BindingInstance */ protected function proxy(): BindingContext { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php000064400000011421150364341760021732 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'userSid' => Values::array_get($payload, 'user_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserBindingContext Context for this UserBindingInstance */ protected function proxy(): UserBindingContext { if (!$this->context) { $this->context = new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php000064400000013530150364341760021104 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Bindings'; } /** * Reads UserBindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserBindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UserBindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserBindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserBindingPage Page of UserBindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserBindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserBindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserBindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserBindingPage Page of UserBindingInstance */ public function getPage(string $targetUrl): UserBindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserBindingPage($this->version, $response, $this->solution); } /** * Constructs a UserBindingContext * * @param string $sid */ public function getContext( string $sid ): UserBindingContext { return new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserBindingList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php000064400000005144150364341760021617 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php000064400000007274150364341760021623 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels/' . \rawurlencode($channelSid) .''; } /** * Delete the UserChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php000064400000012103150364341760021726 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserChannelContext Context for this UserChannelInstance */ protected function proxy(): UserChannelContext { if (!$this->context) { $this->context = new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } return $this->context; } /** * Delete the UserChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { return $this->proxy()->fetch(); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserChannelInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php000064400000003415150364341760021625 0ustar00options['bindingType'] = $bindingType; } /** * * * @param string $bindingType * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadUserBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php000064400000003214150364341760021041 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php000064400000013037150364341760021104 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels'; } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserChannelPage Page of UserChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserChannelPage Page of UserChannelInstance */ public function getPage(string $targetUrl): UserChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Constructs a UserChannelContext * * @param string $channelSid */ public function getContext( string $channelSid ): UserChannelContext { return new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $channelSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php000064400000006116150364341760021624 0ustar00options['notificationLevel'] = $notificationLevel; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; } /** * @param string $notificationLevel * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * * * @param int $lastConsumedMessageIndex * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * * * @param \DateTime $lastConsumptionTimestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateUserChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php000064400000003214150364341760021043 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserList.php000064400000014342150364341760016675 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php000064400000027771150364341760020061 0ustar00options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $createdBy * @return $this Fluent Builder */ public function setCreatedBy(string $createdBy): self { $this->options['createdBy'] = $createdBy; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateChannelOptions ' . $options . ']'; } } class DeleteChannelOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.DeleteChannelOptions ' . $options . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type */ public function __construct( array $type = Values::ARRAY_NONE ) { $this->options['type'] = $type; } /** * * * @param string $type * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadChannelOptions ' . $options . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $createdBy * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $createdBy * @return $this Fluent Builder */ public function setCreatedBy(string $createdBy): self { $this->options['createdBy'] = $createdBy; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php000064400000015234150364341760020566 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites'; } /** * Create the InviteInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return InviteInstance Created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): InviteInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InvitePage Page of InviteInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InvitePage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InvitePage Page of InviteInstance */ public function getPage(string $targetUrl): InvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid */ public function getContext( string $sid ): InviteContext { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.InviteList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php000064400000027526150364341760021443 0ustar00options['from'] = $from; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['body'] = $body; $this->options['mediaSid'] = $mediaSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $lastUpdatedBy * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * * * @param string $body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * * * @param string $mediaSid * @return $this Fluent Builder */ public function setMediaSid(string $mediaSid): self { $this->options['mediaSid'] = $mediaSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateMessageOptions ' . $options . ']'; } } class DeleteMessageOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.DeleteMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * * * @param string $order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body * @param string $attributes * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $lastUpdatedBy * @param string $from * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $from = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['from'] = $from; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $lastUpdatedBy * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php000064400000015564150364341760020734 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $type * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.WebhookList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php000064400000021641150364341760021445 0ustar00options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * * * @param string $configurationUrl * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * * * @param string[] $configurationFilters * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * * * @param string[] $configurationTriggers * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * * * @param string $configurationFlowSid * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * * * @param int $configurationRetryCount * @return $this Fluent Builder */ public function setConfigurationRetryCount(int $configurationRetryCount): self { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl * @param string $configurationMethod * @param string[] $configurationFilters * @param string[] $configurationTriggers * @param string $configurationFlowSid * @param int $configurationRetryCount */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * * * @param string $configurationUrl * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * * * @param string[] $configurationFilters * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * * * @param string[] $configurationTriggers * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * * * @param string $configurationFlowSid * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * * * @param int $configurationRetryCount * @return $this Fluent Builder */ public function setConfigurationRetryCount(int $configurationRetryCount): self { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php000064400000005116150364341760021275 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites/' . \rawurlencode($sid) .''; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php000064400000012421150364341760021363 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), 'attributes' => Values::array_get($payload, 'attributes'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MemberInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php000064400000005431150364341760021304 0ustar00options['roleSid'] = $roleSid; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateInviteOptions ' . $options . ']'; } } class ReadInviteOptions extends Options { /** * @param string[] $identity */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadInviteOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php000064400000007660150364341760021443 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php000064400000011436150364341760021557 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'type' => Values::array_get($payload, 'type'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php000064400000011002150364341760021404 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InviteContext Context for this InviteInstance */ protected function proxy(): InviteContext { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php000064400000003175150364341760020656 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php000064400000010252150364341760021243 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members/' . \rawurlencode($sid) .''; } /** * Delete the MemberInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php000064400000010131150364341760021414 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'From' => $options['from'], ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php000064400000003167150364341760020502 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php000064400000016355150364341760020544 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members'; } /** * Create the MemberInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return MemberInstance Created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid */ public function getContext( string $sid ): MemberContext { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.MemberList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php000064400000030315150364341760021254 0ustar00options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param int $lastConsumedMessageIndex * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * * * @param \DateTime $lastConsumptionTimestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateMemberOptions ' . $options . ']'; } } class DeleteMemberOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.DeleteMemberOptions ' . $options . ']'; } } class ReadMemberOptions extends Options { /** * @param string[] $identity */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadMemberOptions ' . $options . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid * @param int $lastConsumedMessageIndex * @param \DateTime $lastConsumptionTimestamp * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param int $lastConsumedMessageIndex * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * * * @param \DateTime $lastConsumptionTimestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php000064400000003175150364341760020670 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php000064400000016113150364341760020711 0ustar00solution = [ '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'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.MessageList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php000064400000013006150364341760021540 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'lastUpdatedBy' => Values::array_get($payload, 'last_updated_by'), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'type' => Values::array_get($payload, 'type'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php000064400000003167150364341760020531 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingList.php000064400000013312150364341760017325 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings'; } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BindingPage Page of BindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BindingPage Page of BindingInstance */ public function getPage(string $targetUrl): BindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid */ public function getContext( string $sid ): BindingContext { return new BindingContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.BindingList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php000064400000016355150364341760020046 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members */ protected function getMembers(): MemberList { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the invites */ protected function getInvites(): InviteList { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php000064400000003116150364341760017267 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RolePage.php000064400000003074150364341760016621 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceOptions.php000064400000052620150364341760016500 0ustar00options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $defaultServiceRoleSid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * * * @param string $defaultChannelRoleSid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * * * @param string $defaultChannelCreatorRoleSid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * * * @param bool $readStatusEnabled * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * * * @param bool $reachabilityEnabled * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * * * @param int $typingIndicatorTimeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * * * @param int $consumptionReportInterval * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * * * @param bool $notificationsNewMessageEnabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * * * @param string $notificationsNewMessageTemplate * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * * * @param string $notificationsNewMessageSound * @return $this Fluent Builder */ public function setNotificationsNewMessageSound(string $notificationsNewMessageSound): self { $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; return $this; } /** * * * @param bool $notificationsNewMessageBadgeCountEnabled * @return $this Fluent Builder */ public function setNotificationsNewMessageBadgeCountEnabled(bool $notificationsNewMessageBadgeCountEnabled): self { $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; return $this; } /** * * * @param bool $notificationsAddedToChannelEnabled * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * * * @param string $notificationsAddedToChannelTemplate * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * * * @param string $notificationsAddedToChannelSound * @return $this Fluent Builder */ public function setNotificationsAddedToChannelSound(string $notificationsAddedToChannelSound): self { $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; return $this; } /** * * * @param bool $notificationsRemovedFromChannelEnabled * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * * * @param string $notificationsRemovedFromChannelTemplate * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * * * @param string $notificationsRemovedFromChannelSound * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelSound(string $notificationsRemovedFromChannelSound): self { $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; return $this; } /** * * * @param bool $notificationsInvitedToChannelEnabled * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * * * @param string $notificationsInvitedToChannelTemplate * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * * * @param string $notificationsInvitedToChannelSound * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelSound(string $notificationsInvitedToChannelSound): self { $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; return $this; } /** * * * @param string $preWebhookUrl * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * * * @param string $postWebhookUrl * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * * * @param string $webhookMethod * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * * * @param string[] $webhookFilters * @return $this Fluent Builder */ public function setWebhookFilters(array $webhookFilters): self { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * * * @param int $limitsChannelMembers * @return $this Fluent Builder */ public function setLimitsChannelMembers(int $limitsChannelMembers): self { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * * * @param int $limitsUserChannels * @return $this Fluent Builder */ public function setLimitsUserChannels(int $limitsUserChannels): self { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * * * @param string $mediaCompatibilityMessage * @return $this Fluent Builder */ public function setMediaCompatibilityMessage(string $mediaCompatibilityMessage): self { $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; return $this; } /** * * * @param int $preWebhookRetryCount * @return $this Fluent Builder */ public function setPreWebhookRetryCount(int $preWebhookRetryCount): self { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * * * @param int $postWebhookRetryCount * @return $this Fluent Builder */ public function setPostWebhookRetryCount(int $postWebhookRetryCount): self { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * * * @param bool $notificationsLogEnabled * @return $this Fluent Builder */ public function setNotificationsLogEnabled(bool $notificationsLogEnabled): self { $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialList.php000064400000014341150364341760016430 0ustar00solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.CredentialList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceList.php000064400000013162150364341760015756 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.ServiceList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServicePage.php000064400000003037150364341760015717 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\IpMessaging\V2\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.ServicePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialOptions.php000064400000016542150364341760017155 0ustar00options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * * * @param string $privateKey * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * * * @param bool $sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * * * @param string $apiKey * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * * * @param string $secret * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName * @param string $certificate * @param string $privateKey * @param bool $sandbox * @param string $apiKey * @param string $secret */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * * * @param string $privateKey * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * * * @param bool $sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * * * @param string $apiKey * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * * * @param string $secret * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialInstance.php000064400000010675150364341760017267 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php000064400000022313150364341760016465 0ustar00solution = [ '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'], '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 bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList( $this->version, $this->solution['sid'] ); } return $this->_bindings; } /** * Access the roles */ protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList( $this->version, $this->solution['sid'] ); } return $this->_roles; } /** * Access the users */ protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList( $this->version, $this->solution['sid'] ); } return $this->_users; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialPage.php000064400000003061150364341760016366 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceInstance.php000064400000016256150364341760016616 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), 'notifications' => Values::array_get($payload, 'notifications'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the channels */ protected function getChannels(): ChannelList { return $this->proxy()->channels; } /** * Access the bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php000064400000006437150364341760017150 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2.php000064400000005757150364341760013535 0ustar00version = 'v2'; } protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php000064400000011073150364341760017506 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php000064400000011553150364341760017406 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleList.php000064400000014071150364341760016656 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName * @param string $type * @param string[] $permission * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.RoleList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php000064400000011232150364341760017407 0ustar00options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid * @param string $attributes * @param string $friendlyName */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserPage.php000064400000003074150364341760016635 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php000064400000014703150364341760017327 0ustar00solution = [ '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'] ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.ChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php000064400000003116150364341760017264 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php000064400000012611150364341760017522 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php000064400000006054150364341760017371 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php000064400000013523150364341760020157 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php000064400000005707150364341760021741 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php000064400000003214150364341760021040 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php000064400000012233150364341760021100 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels'; } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserChannelPage Page of UserChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserChannelPage Page of UserChannelInstance */ public function getPage(string $targetUrl): UserChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.UserChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserList.php000064400000014165150364341760016677 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.UserList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php000064400000014251150364341760020045 0ustar00options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateChannelOptions ' . $options . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type */ public function __construct( array $type = Values::ARRAY_NONE ) { $this->options['type'] = $type; } /** * * * @param string $type * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.ReadChannelOptions ' . $options . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php000064400000015234150364341760020565 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites'; } /** * Create the InviteInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return InviteInstance Created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): InviteInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InvitePage Page of InviteInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InvitePage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InvitePage Page of InviteInstance */ public function getPage(string $targetUrl): InvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid */ public function getContext( string $sid ): InviteContext { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.InviteList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php000064400000011261150364341760021427 0ustar00options['from'] = $from; $this->options['attributes'] = $attributes; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * * * @param string $order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body * @param string $attributes */ public function __construct( string $body = Values::NONE, string $attributes = Values::NONE ) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * * * @param string $body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php000064400000005116150364341760021274 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites/' . \rawurlencode($sid) .''; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php000064400000012122150364341760021360 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php000064400000005431150364341760021303 0ustar00options['roleSid'] = $roleSid; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateInviteOptions ' . $options . ']'; } } class ReadInviteOptions extends Options { /** * @param string[] $identity */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.ReadInviteOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php000064400000011002150364341760021403 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InviteContext Context for this InviteInstance */ protected function proxy(): InviteContext { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php000064400000003175150364341760020655 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php000064400000006671150364341760021254 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members/' . \rawurlencode($sid) .''; } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php000064400000006646150364341760021433 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Attributes' => $options['attributes'], ]); $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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php000064400000003167150364341760020501 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php000064400000015234150364341760020536 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members'; } /** * Create the MemberInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return MemberInstance Created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid */ public function getContext( string $sid ): MemberContext { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.MemberList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php000064400000010733150364341760021255 0ustar00options['roleSid'] = $roleSid; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateMemberOptions ' . $options . ']'; } } class ReadMemberOptions extends Options { /** * @param string[] $identity */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.ReadMemberOptions ' . $options . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid * @param int $lastConsumedMessageIndex */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param int $lastConsumedMessageIndex * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php000064400000015231150364341760020710 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages'; } /** * Create the MessageInstance * * @param string $body * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $body, array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $body, 'From' => $options['from'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.MessageList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php000064400000012206150364341760021540 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php000064400000003167150364341760020530 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php000064400000014071150364341760020036 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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 invites */ protected function getInvites(): InviteList { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RolePage.php000064400000003074150364341760016620 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServiceOptions.php000064400000111105150364341760016471 0ustar00options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $defaultServiceRoleSid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * * * @param string $defaultChannelRoleSid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * * * @param string $defaultChannelCreatorRoleSid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * * * @param bool $readStatusEnabled * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * * * @param bool $reachabilityEnabled * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * * * @param int $typingIndicatorTimeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * * * @param int $consumptionReportInterval * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * * * @param bool $notificationsNewMessageEnabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * * * @param string $notificationsNewMessageTemplate * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * * * @param bool $notificationsAddedToChannelEnabled * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * * * @param string $notificationsAddedToChannelTemplate * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * * * @param bool $notificationsRemovedFromChannelEnabled * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * * * @param string $notificationsRemovedFromChannelTemplate * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * * * @param bool $notificationsInvitedToChannelEnabled * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * * * @param string $notificationsInvitedToChannelTemplate * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * * * @param string $preWebhookUrl * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * * * @param string $postWebhookUrl * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * * * @param string $webhookMethod * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * * * @param string[] $webhookFilters * @return $this Fluent Builder */ public function setWebhookFilters(array $webhookFilters): self { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * * * @param string $webhooksOnMessageSendUrl * @return $this Fluent Builder */ public function setWebhooksOnMessageSendUrl(string $webhooksOnMessageSendUrl): self { $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; return $this; } /** * * * @param string $webhooksOnMessageSendMethod * @return $this Fluent Builder */ public function setWebhooksOnMessageSendMethod(string $webhooksOnMessageSendMethod): self { $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; return $this; } /** * * * @param string $webhooksOnMessageUpdateUrl * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateUrl(string $webhooksOnMessageUpdateUrl): self { $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; return $this; } /** * * * @param string $webhooksOnMessageUpdateMethod * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateMethod(string $webhooksOnMessageUpdateMethod): self { $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; return $this; } /** * * * @param string $webhooksOnMessageRemoveUrl * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveUrl(string $webhooksOnMessageRemoveUrl): self { $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; return $this; } /** * * * @param string $webhooksOnMessageRemoveMethod * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveMethod(string $webhooksOnMessageRemoveMethod): self { $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; return $this; } /** * * * @param string $webhooksOnChannelAddUrl * @return $this Fluent Builder */ public function setWebhooksOnChannelAddUrl(string $webhooksOnChannelAddUrl): self { $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; return $this; } /** * * * @param string $webhooksOnChannelAddMethod * @return $this Fluent Builder */ public function setWebhooksOnChannelAddMethod(string $webhooksOnChannelAddMethod): self { $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; return $this; } /** * * * @param string $webhooksOnChannelDestroyUrl * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyUrl(string $webhooksOnChannelDestroyUrl): self { $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; return $this; } /** * * * @param string $webhooksOnChannelDestroyMethod * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyMethod(string $webhooksOnChannelDestroyMethod): self { $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; return $this; } /** * * * @param string $webhooksOnChannelUpdateUrl * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateUrl(string $webhooksOnChannelUpdateUrl): self { $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; return $this; } /** * * * @param string $webhooksOnChannelUpdateMethod * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateMethod(string $webhooksOnChannelUpdateMethod): self { $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; return $this; } /** * * * @param string $webhooksOnMemberAddUrl * @return $this Fluent Builder */ public function setWebhooksOnMemberAddUrl(string $webhooksOnMemberAddUrl): self { $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; return $this; } /** * * * @param string $webhooksOnMemberAddMethod * @return $this Fluent Builder */ public function setWebhooksOnMemberAddMethod(string $webhooksOnMemberAddMethod): self { $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; return $this; } /** * * * @param string $webhooksOnMemberRemoveUrl * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveUrl(string $webhooksOnMemberRemoveUrl): self { $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; return $this; } /** * * * @param string $webhooksOnMemberRemoveMethod * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveMethod(string $webhooksOnMemberRemoveMethod): self { $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; return $this; } /** * * * @param string $webhooksOnMessageSentUrl * @return $this Fluent Builder */ public function setWebhooksOnMessageSentUrl(string $webhooksOnMessageSentUrl): self { $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; return $this; } /** * * * @param string $webhooksOnMessageSentMethod * @return $this Fluent Builder */ public function setWebhooksOnMessageSentMethod(string $webhooksOnMessageSentMethod): self { $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; return $this; } /** * * * @param string $webhooksOnMessageUpdatedUrl * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedUrl(string $webhooksOnMessageUpdatedUrl): self { $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; return $this; } /** * * * @param string $webhooksOnMessageUpdatedMethod * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedMethod(string $webhooksOnMessageUpdatedMethod): self { $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; return $this; } /** * * * @param string $webhooksOnMessageRemovedUrl * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedUrl(string $webhooksOnMessageRemovedUrl): self { $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; return $this; } /** * * * @param string $webhooksOnMessageRemovedMethod * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedMethod(string $webhooksOnMessageRemovedMethod): self { $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; return $this; } /** * * * @param string $webhooksOnChannelAddedUrl * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedUrl(string $webhooksOnChannelAddedUrl): self { $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; return $this; } /** * * * @param string $webhooksOnChannelAddedMethod * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedMethod(string $webhooksOnChannelAddedMethod): self { $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; return $this; } /** * * * @param string $webhooksOnChannelDestroyedUrl * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedUrl(string $webhooksOnChannelDestroyedUrl): self { $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; return $this; } /** * * * @param string $webhooksOnChannelDestroyedMethod * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedMethod(string $webhooksOnChannelDestroyedMethod): self { $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; return $this; } /** * * * @param string $webhooksOnChannelUpdatedUrl * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedUrl(string $webhooksOnChannelUpdatedUrl): self { $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; return $this; } /** * * * @param string $webhooksOnChannelUpdatedMethod * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedMethod(string $webhooksOnChannelUpdatedMethod): self { $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; return $this; } /** * * * @param string $webhooksOnMemberAddedUrl * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedUrl(string $webhooksOnMemberAddedUrl): self { $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; return $this; } /** * * * @param string $webhooksOnMemberAddedMethod * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedMethod(string $webhooksOnMemberAddedMethod): self { $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; return $this; } /** * * * @param string $webhooksOnMemberRemovedUrl * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedUrl(string $webhooksOnMemberRemovedUrl): self { $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; return $this; } /** * * * @param string $webhooksOnMemberRemovedMethod * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedMethod(string $webhooksOnMemberRemovedMethod): self { $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; return $this; } /** * * * @param int $limitsChannelMembers * @return $this Fluent Builder */ public function setLimitsChannelMembers(int $limitsChannelMembers): self { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * * * @param int $limitsUserChannels * @return $this Fluent Builder */ public function setLimitsUserChannels(int $limitsUserChannels): self { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialList.php000064400000014341150364341760016427 0ustar00solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.CredentialList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServiceList.php000064400000013162150364341760015755 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.ServiceList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServicePage.php000064400000003037150364341760015716 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialOptions.php000064400000016542150364341760017154 0ustar00options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * * * @param string $privateKey * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * * * @param bool $sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * * * @param string $apiKey * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * * * @param string $secret * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName * @param string $certificate * @param string $privateKey * @param bool $sandbox * @param string $apiKey * @param string $secret */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * * * @param string $privateKey * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * * * @param bool $sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * * * @param string $apiKey * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * * * @param string $secret * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialInstance.php000064400000010675150364341760017266 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php000064400000025717150364341760016477 0ustar00solution = [ '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'], '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) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialPage.php000064400000003061150364341760016365 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServiceInstance.php000064400000015277150364341760016617 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'webhooks' => Values::array_get($payload, 'webhooks'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'notifications' => Values::array_get($payload, 'notifications'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the channels */ protected function getChannels(): ChannelList { return $this->proxy()->channels; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php000064400000006437150364341760017147 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/ChatBase.php000064400000005574150364341760012507 0ustar00baseUrl = 'https://chat.twilio.com'; } /** * @return V1 Version v1 of chat */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of chat */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * @return V3 Version v3 of chat */ protected function getV3(): V3 { if (!$this->_v3) { $this->_v3 = new V3($this); } return $this->_v3; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat]'; } } sdk/src/Twilio/Rest/Events.php000064400000004777150364341760012305 0ustar00eventTypes instead. */ protected function getEventTypes(): \Twilio\Rest\Events\V1\EventTypeList { echo "eventTypes is deprecated. Use v1->eventTypes instead."; return $this->v1->eventTypes; } /** * @deprecated Use v1->eventTypes(\$type) instead. * @param string $type A string that uniquely identifies this Event Type. */ protected function contextEventTypes(string $type): \Twilio\Rest\Events\V1\EventTypeContext { echo "eventTypes(\$type) is deprecated. Use v1->eventTypes(\$type) instead."; return $this->v1->eventTypes($type); } /** * @deprecated Use v1->schemas instead. */ protected function getSchemas(): \Twilio\Rest\Events\V1\SchemaList { echo "schemas is deprecated. Use v1->schemas instead."; return $this->v1->schemas; } /** * @deprecated Use v1->schemas(\$id) instead. * @param string $id The unique identifier of the schema. */ protected function contextSchemas(string $id): \Twilio\Rest\Events\V1\SchemaContext { echo "schemas(\$id) is deprecated. Use v1->schemas(\$id) instead."; return $this->v1->schemas($id); } /** * @deprecated Use v1->sinks instead. */ protected function getSinks(): \Twilio\Rest\Events\V1\SinkList { echo "sinks is deprecated. Use v1->sinks instead."; return $this->v1->sinks; } /** * @deprecated Use v1->sinks(\$sid) instead * @param string $sid A string that uniquely identifies this Sink. */ protected function contextSinks(string $sid): \Twilio\Rest\Events\V1\SinkContext { echo "sinks(\$sid) is deprecated. Use v1->sinks(\$sid) instead."; return $this->v1->sinks($sid); } /** * @deprecated Use v1->subscriptions instead. */ protected function getSubscriptions(): \Twilio\Rest\Events\V1\SubscriptionList { echo "subscriptions is deprecated. Use v1->subscriptions instead."; return $this->v1->subscriptions; } /** * @deprecated Use v1->subscriptions(\$sid) instead. * @param string $sid A string that uniquely identifies this Subscription. */ protected function contextSubscriptions(string $sid): \Twilio\Rest\Events\V1\SubscriptionContext { echo "subscriptions(\$sid) is deprecated. Use v1->subscriptions(\$sid) instead."; return $this->v1->subscriptions($sid); } }sdk/src/Twilio/Rest/Sync.php000064400000001254150364341760011740 0ustar00services instead. */ protected function getServices(): \Twilio\Rest\Sync\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Sync\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } }sdk/src/Twilio/Rest/FlexApi.php000064400000007706150364341760012364 0ustar00assessments instead. */ protected function getAssessments(): \Twilio\Rest\FlexApi\V1\AssessmentsList { echo "assessments is deprecated. Use v1->assessments instead."; return $this->v1->assessments; } /** * @deprecated Use v1->assessments() instead. */ protected function contextAssessments(): \Twilio\Rest\FlexApi\V1\AssessmentsContext { echo "assessments() is deprecated. Use v1->assessments() instead."; return $this->v1->assessments(); } /** * @deprecated Use v1->channel instead. */ protected function getChannel(): \Twilio\Rest\FlexApi\V1\ChannelList { echo "channel is deprecated. Use v1->channel instead."; return $this->v1->channel; } /** * @deprecated Use v1->channel(\$sid) instead. * @param string $sid The SID that identifies the Flex chat channel resource to * fetch */ protected function contextChannel(string $sid): \Twilio\Rest\FlexApi\V1\ChannelContext { echo "channel(\$sid) is deprecated. Use v1->channel(\$sid) instead."; return $this->v1->channel($sid); } /** * @deprecated Use v1->configuration instead. */ protected function getConfiguration(): \Twilio\Rest\FlexApi\V1\ConfigurationList { echo "configuration is deprecated. Use v1->configuration instead."; return $this->v1->configuration; } /** * @deprecated Use v1->configuration() instead. */ protected function contextConfiguration(): \Twilio\Rest\FlexApi\V1\ConfigurationContext { echo "configuration() is deprecated. Use v1->configuration() instead."; return $this->v1->configuration(); } /** * @deprecated Use v1->flexFlow instead. */ protected function getFlexFlow(): \Twilio\Rest\FlexApi\V1\FlexFlowList { echo "flexFlow is deprecated. Use v1->flexFlow instead."; return $this->v1->flexFlow; } /** * @deprecated Use v1->flexFlow(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextFlexFlow(string $sid): \Twilio\Rest\FlexApi\V1\FlexFlowContext { echo "flexFlow(\$sid) is deprecated. Use v1->flexFlow(\$sid) instead."; return $this->v1->flexFlow($sid); } /** * @deprecated Use v1->interaction instead. */ protected function getInteraction(): \Twilio\Rest\FlexApi\V1\InteractionList { echo "interaction is deprecated. Use v1->interaction instead."; return $this->v1->interaction; } /** * @deprecated Use v1->interaction(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextInteraction(string $sid): \Twilio\Rest\FlexApi\V1\InteractionContext { echo "interaction(\$sid) is deprecated. Use v1->interaction(\$sid) instead."; return $this->v1->interaction($sid); } /** * @deprecated Use v1->webChannel instead. */ protected function getWebChannel(): \Twilio\Rest\FlexApi\V1\WebChannelList { echo "webChannel is deprecated. Use v1->webChannel instead."; return $this->v1->webChannel; } /** * @deprecated Use v1->webChannel(\$sid) instead. * @param string $sid The SID of the WebChannel resource to fetch */ protected function contextWebChannel(string $sid): \Twilio\Rest\FlexApi\V1\WebChannelContext { echo "webChannel(\$sid) is deprecated. Use v1->webChannel(\$sid) instead."; return $this->v1->webChannel($sid); } /** * @deprecated Use v2->webChannels instead. */ protected function getWebChannels(): \Twilio\Rest\FlexApi\V2\WebChannelsList { echo "webChannels is deprecated. Use v2->webChannels instead."; return $this->v2->webChannels; } }sdk/src/Twilio/Rest/Monitor/V1.php000064400000005572150364341760012750 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventList.php000064400000013370150364341760014660 0ustar00solution = [ ]; $this->uri = '/Events'; } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EventPage Page of EventInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EventPage { $options = new Values($options); $params = Values::of([ 'ActorSid' => $options['actorSid'], 'EventType' => $options['eventType'], 'ResourceSid' => $options['resourceSid'], 'SourceIpAddress' => $options['sourceIpAddress'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EventPage Page of EventInstance */ public function getPage(string $targetUrl): EventPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Constructs a EventContext * * @param string $sid The SID of the Event resource to fetch. */ public function getContext( string $sid ): EventContext { return new EventContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Monitor.V1.EventList]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventContext.php000064400000003645150364341760015375 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertPage.php000064400000003002150364341760014576 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertInstance.php000064400000012054150364341760015475 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertOptions.php000064400000011032150364341760015357 0ustar00options['logLevel'] = $logLevel; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. * * @param string $logLevel Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. * @return $this Fluent Builder */ public function setLogLevel(string $logLevel): self { $this->options['logLevel'] = $logLevel; return $this; } /** * Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * * @param \DateTime $startDate Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * * @param \DateTime $endDate Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Monitor.V1.ReadAlertOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/EventPage.php000064400000003002150364341760014610 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertList.php000064400000013042150364341760014642 0ustar00solution = [ ]; $this->uri = '/Alerts'; } /** * Reads AlertInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AlertInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AlertInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AlertInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AlertPage Page of AlertInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AlertPage { $options = new Values($options); $params = Values::of([ 'LogLevel' => $options['logLevel'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AlertPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AlertInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AlertPage Page of AlertInstance */ public function getPage(string $targetUrl): AlertPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AlertPage($this->version, $response, $this->solution); } /** * Constructs a AlertContext * * @param string $sid The SID of the Alert resource to fetch. */ public function getContext( string $sid ): AlertContext { return new AlertContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Monitor.V1.AlertList]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventOptions.php000064400000015743150364341760015406 0ustar00options['actorSid'] = $actorSid; $this->options['eventType'] = $eventType; $this->options['resourceSid'] = $resourceSid; $this->options['sourceIpAddress'] = $sourceIpAddress; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. * * @param string $actorSid Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. * @return $this Fluent Builder */ public function setActorSid(string $actorSid): self { $this->options['actorSid'] = $actorSid; return $this; } /** * Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). * * @param string $eventType Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). * @return $this Fluent Builder */ public function setEventType(string $eventType): self { $this->options['eventType'] = $eventType; return $this; } /** * Only include events that refer to this resource. Useful for discovering the history of a specific resource. * * @param string $resourceSid Only include events that refer to this resource. Useful for discovering the history of a specific resource. * @return $this Fluent Builder */ public function setResourceSid(string $resourceSid): self { $this->options['resourceSid'] = $resourceSid; return $this; } /** * Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. * * @param string $sourceIpAddress Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. * @return $this Fluent Builder */ public function setSourceIpAddress(string $sourceIpAddress): self { $this->options['sourceIpAddress'] = $sourceIpAddress; return $this; } /** * Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $endDate Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Monitor.V1.ReadEventOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertContext.php000064400000003645150364341760015363 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/EventInstance.php000064400000010605150364341760015507 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Intelligence.php000064400000000116150364341760013422 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleInstance.php000064400000012146150364341760016162 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserContext.php000064400000013554150364341760016063 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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 userBindings */ protected function getUserBindings(): UserBindingList { if (!$this->_userBindings) { $this->_userBindings = new UserBindingList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userBindings; } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleList.php000064400000015021150364341760015324 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $type * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The SID of the Role resource to delete. */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.RoleList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingContext.php000064400000005023150364341760016507 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserOptions.php000064400000020423150364341760016063 0ustar00options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the new resource. This value is often used for display purposes. * * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the resource. It is often used for display purposes. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserPage.php000064400000003037150364341760015306 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelList.php000064400000016062150364341760016001 0ustar00solution = [ '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'] ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The SID of the Channel resource to delete. This value can be either the `sid` or the `unique_name` of the Channel resource to delete. */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.ChannelList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelPage.php000064400000003061150364341760015735 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserInstance.php000064400000013522150364341760016176 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userBindings */ protected function getUserBindings(): UserBindingList { return $this->proxy()->userBindings; } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleContext.php000064400000007127150364341760016045 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingOptions.php000064400000007404150364341760016523 0ustar00options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelInstance.php000064400000014531150364341760016631 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingInstance.php000064400000011352150364341760016631 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BindingContext Context for this BindingInstance */ protected function proxy(): BindingContext { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php000064400000012221150364341760020402 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'userSid' => Values::array_get($payload, 'user_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserBindingContext Context for this UserBindingInstance */ protected function proxy(): UserBindingContext { if (!$this->context) { $this->context = new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php000064400000014330150364341760017554 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Bindings'; } /** * Reads UserBindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserBindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UserBindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserBindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserBindingPage Page of UserBindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserBindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserBindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserBindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserBindingPage Page of UserBindingInstance */ public function getPage(string $targetUrl): UserBindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserBindingPage($this->version, $response, $this->solution); } /** * Constructs a UserBindingContext * * @param string $sid The SID of the User Binding resource to delete. */ public function getContext( string $sid ): UserBindingContext { return new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserBindingList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php000064400000005744150364341760020276 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php000064400000010314150364341760020261 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels/' . \rawurlencode($channelSid) .''; } /** * Delete the UserChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserChannelInstance { $options = new Values($options); $data = Values::of([ 'NotificationLevel' => $options['notificationLevel'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php000064400000012674150364341760020414 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserChannelContext Context for this UserChannelInstance */ protected function proxy(): UserChannelContext { if (!$this->context) { $this->context = new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } return $this->context; } /** * Delete the UserChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { return $this->proxy()->fetch(); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserChannelInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php000064400000005123150364341760020274 0ustar00options['bindingType'] = $bindingType; } /** * The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadUserBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php000064400000003157150364341760017520 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php000064400000013505150364341760017555 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels'; } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserChannelPage Page of UserChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserChannelPage Page of UserChannelInstance */ public function getPage(string $targetUrl): UserChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Constructs a UserChannelContext * * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the resource belongs to. */ public function getContext( string $channelSid ): UserChannelContext { return new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $channelSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserChannelList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php000064400000014115150364341760020273 0ustar00options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.DeleteUserChannelOptions ' . $options . ']'; } } class UpdateUserChannelOptions extends Options { /** * @param string $notificationLevel * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). */ public function __construct( string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null ) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; } /** * @param string $notificationLevel * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateUserChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php000064400000003157150364341760017522 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserList.php000064400000015344150364341760015351 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). This value is often a username or email address. See the Identity documentation for more info. * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelOptions.php000064400000050452150364341760016522 0ustar00options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `identity` of the User that created the channel. Default is: `system`. * * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @return $this Fluent Builder */ public function setCreatedBy(string $createdBy): self { $this->options['createdBy'] = $createdBy; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateChannelOptions ' . $options . ']'; } } class DeleteChannelOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.DeleteChannelOptions ' . $options . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ public function __construct( array $type = Values::ARRAY_NONE ) { $this->options['type'] = $type; } /** * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadChannelOptions ' . $options . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 256 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `identity` of the User that created the channel. Default is: `system`. * * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @return $this Fluent Builder */ public function setCreatedBy(string $createdBy): self { $this->options['createdBy'] = $createdBy; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php000064400000016351150364341760017240 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites'; } /** * Create the InviteInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. * @param array|Options $options Optional Arguments * @return InviteInstance Created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): InviteInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InvitePage Page of InviteInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InvitePage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InvitePage Page of InviteInstance */ public function getPage(string $targetUrl): InvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid The SID of the Invite resource to delete. */ public function getContext( string $sid ): InviteContext { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.InviteList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php000064400000047243150364341760020112 0ustar00options['from'] = $from; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['body'] = $body; $this->options['mediaSid'] = $mediaSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. * * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. * * @param string $mediaSid The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. * @return $this Fluent Builder */ public function setMediaSid(string $mediaSid): self { $this->options['mediaSid'] = $mediaSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateMessageOptions ' . $options . ']'; } } class DeleteMessageOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.DeleteMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param string $attributes A valid JSON string that contains application-specific data. * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $from = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['from'] = $from; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php000064400000016310150364341760017373 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $type * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid The SID of the Channel Webhook resource to delete. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.WebhookList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php000064400000040710150364341760020114 0ustar00options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. * * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * @return $this Fluent Builder */ public function setConfigurationRetryCount(int $configurationRetryCount): self { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @param string $configurationMethod * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * @return $this Fluent Builder */ public function setConfigurationRetryCount(int $configurationRetryCount): self { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php000064400000005576150364341760017760 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites/' . \rawurlencode($sid) .''; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php000064400000013206150364341760020036 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), 'attributes' => Values::array_get($payload, 'attributes'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MemberInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php000064400000007634150364341760017764 0ustar00options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateInviteOptions ' . $options . ']'; } } class ReadInviteOptions extends Options { /** * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadInviteOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php000064400000010404150364341760020102 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php000064400000012162150364341760020225 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'type' => Values::array_get($payload, 'type'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php000064400000011462150364341760020067 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InviteContext Context for this InviteInstance */ protected function proxy(): InviteContext { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php000064400000003140150364341760017317 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php000064400000011037150364341760017716 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members/' . \rawurlencode($sid) .''; } /** * Delete the MemberInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php000064400000010614150364341760020073 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['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['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'From' => $options['from'], ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php000064400000003132150364341760017143 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php000064400000017577150364341760017224 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members'; } /** * Create the MemberInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. * @param array|Options $options Optional Arguments * @return MemberInstance Created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid The SID of the Member resource to delete. This value can be either the Member's `sid` or its `identity` value. */ public function getContext( string $sid ): MemberContext { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.MemberList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php000064400000055472150364341760017740 0ustar00options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. * * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateMemberOptions ' . $options . ']'; } } class DeleteMemberOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.DeleteMemberOptions ' . $options . ']'; } } class ReadMemberOptions extends Options { /** * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadMemberOptions ' . $options . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php000064400000003140150364341760017331 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php000064400000016576150364341760017377 0ustar00solution = [ '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'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The SID of the Message resource to delete. */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.MessageList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php000064400000013471150364341760020217 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'lastUpdatedBy' => Values::array_get($payload, 'last_updated_by'), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'type' => Values::array_get($payload, 'type'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php000064400000003132150364341760017172 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingList.php000064400000013523150364341760016002 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings'; } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BindingPage Page of BindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BindingPage Page of BindingInstance */ public function getPage(string $targetUrl): BindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid The SID of the Binding resource to delete. */ public function getContext( string $sid ): BindingContext { return new BindingContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.BindingList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php000064400000016633150364341760016516 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members */ protected function getMembers(): MemberList { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the invites */ protected function getInvites(): InviteList { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingPage.php000064400000003061150364341760015737 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RolePage.php000064400000003037150364341760015271 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceOptions.php000064400000113656150364341760015160 0ustar00options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; } /** * A descriptive string that you create to describe the resource. * * @param string $friendlyName A descriptive string that you create to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * Whether to send a notification when a new message is added to a channel. The default is `false`. * * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageSound The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsNewMessageSound(string $notificationsNewMessageSound): self { $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; return $this; } /** * Whether the new message badge is enabled. The default is `false`. * * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsNewMessageBadgeCountEnabled(bool $notificationsNewMessageBadgeCountEnabled): self { $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; return $this; } /** * Whether to send a notification when a member is added to a channel. The default is `false`. * * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelSound The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelSound(string $notificationsAddedToChannelSound): self { $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; return $this; } /** * Whether to send a notification to a user when they are removed from a channel. The default is `false`. * * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelSound The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelSound(string $notificationsRemovedFromChannelSound): self { $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; return $this; } /** * Whether to send a notification when a user is invited to a channel. The default is `false`. * * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelSound The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelSound(string $notificationsInvitedToChannelSound): self { $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; return $this; } /** * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string[] $webhookFilters The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setWebhookFilters(array $webhookFilters): self { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * @return $this Fluent Builder */ public function setLimitsChannelMembers(int $limitsChannelMembers): self { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * @return $this Fluent Builder */ public function setLimitsUserChannels(int $limitsUserChannels): self { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * The message to send when a media message has no text. Can be used as placeholder message. * * @param string $mediaCompatibilityMessage The message to send when a media message has no text. Can be used as placeholder message. * @return $this Fluent Builder */ public function setMediaCompatibilityMessage(string $mediaCompatibilityMessage): self { $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; return $this; } /** * The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. * * @param int $preWebhookRetryCount The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. * @return $this Fluent Builder */ public function setPreWebhookRetryCount(int $preWebhookRetryCount): self { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. * * @param int $postWebhookRetryCount The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. * @return $this Fluent Builder */ public function setPostWebhookRetryCount(int $postWebhookRetryCount): self { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * Whether to log notifications. The default is `false`. * * @param bool $notificationsLogEnabled Whether to log notifications. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsLogEnabled(bool $notificationsLogEnabled): self { $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialList.php000064400000014370150364341760015103 0ustar00solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid The SID of the Credential resource to delete. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.CredentialList]'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceList.php000064400000013310150364341760014422 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.ServiceList]'; } } sdk/src/Twilio/Rest/Chat/V2/ServicePage.php000064400000003002150364341760014360 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialOptions.php000064400000033635150364341760015630 0ustar00options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialInstance.php000064400000010724150364341760015733 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceContext.php000064400000022247150364341760015144 0ustar00solution = [ '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'], '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 bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList( $this->version, $this->solution['sid'] ); } return $this->_bindings; } /** * Access the roles */ protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList( $this->version, $this->solution['sid'] ); } return $this->_roles; } /** * Access the users */ protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList( $this->version, $this->solution['sid'] ); } return $this->_users; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialPage.php000064400000003024150364341760015036 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceInstance.php000064400000016246150364341760015266 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), 'notifications' => Values::array_get($payload, 'notifications'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the channels */ protected function getChannels(): ChannelList { return $this->proxy()->channels; } /** * Access the bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/.openapi-generator-ignore000064400000002020150364341760016352 0ustar00# OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md sdk/src/Twilio/Rest/Chat/V2/CredentialContext.php000064400000006466150364341760015623 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Chat/V3.php000064400000005075150364341760012200 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Chat/V3/ChannelList.php000064400000003113150364341760014373 0ustar00solution = [ ]; } /** * Constructs a ChannelContext * * @param string $serviceSid The unique SID identifier of the Service. * * @param string $sid A 34 character string that uniquely identifies this Channel. */ public function getContext( string $serviceSid , string $sid ): ChannelContext { return new ChannelContext( $this->version, $serviceSid, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V3.ChannelList]'; } } sdk/src/Twilio/Rest/Chat/V3/ChannelPage.php000064400000003002150364341760014331 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V3/ChannelInstance.php000064400000011453150364341760015232 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Chat/V3/ChannelOptions.php000064400000006715150364341760015126 0ustar00options['type'] = $type; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V3.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V3/.openapi-generator-ignore000064400000002020150364341760016353 0ustar00# OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md sdk/src/Twilio/Rest/Chat/V3/ChannelContext.php000064400000005202150364341760015105 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Chat/V2.php000064400000005666150364341760012205 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleInstance.php000064400000011760150364341760016162 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserContext.php000064400000012010150364341760016044 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleList.php000064400000015130150364341760015324 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $type * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The Twilio-provided string that uniquely identifies the Role resource to delete. */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.RoleList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserOptions.php000064400000015251150364341760016065 0ustar00options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the new resource. This value is often used for display purposes. * * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the resource. It is often used for display purposes. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserPage.php000064400000003037150364341760015305 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelList.php000064400000015152150364341760015777 0ustar00solution = [ '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'] ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The Twilio-provided string that uniquely identifies the Channel resource to delete. */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.ChannelList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelPage.php000064400000003061150364341760015734 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserInstance.php000064400000013046150364341760016176 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleContext.php000064400000006741150364341760016045 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelInstance.php000064400000013745150364341760016636 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php000064400000006210150364341760020400 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php000064400000003157150364341760017517 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php000064400000012534150364341760017555 0ustar00solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels'; } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserChannelPage Page of UserChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserChannelPage Page of UserChannelInstance */ public function getPage(string $targetUrl): UserChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.UserChannelList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserList.php000064400000015101150364341760015337 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). This value is often a username or email address. See the Identity documentation for more details. * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The Twilio-provided string that uniquely identifies the User resource to delete. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.UserList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelOptions.php000064400000023151150364341760016515 0ustar00options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateChannelOptions ' . $options . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ public function __construct( array $type = Values::ARRAY_NONE ) { $this->options['type'] = $type; } /** * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.ReadChannelOptions ' . $options . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php000064400000016317150364341760017241 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites'; } /** * Create the InviteInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more info. * @param array|Options $options Optional Arguments * @return InviteInstance Created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): InviteInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InvitePage Page of InviteInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InvitePage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InvitePage Page of InviteInstance */ public function getPage(string $targetUrl): InvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid The Twilio-provided string that uniquely identifies the Invite resource to delete. */ public function getContext( string $sid ): InviteContext { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.InviteList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php000064400000015451150364341760020105 0ustar00options['from'] = $from; $this->options['attributes'] = $attributes; } /** * The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * * @param string $from The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param string $attributes A valid JSON string that contains application-specific data. */ public function __construct( string $body = Values::NONE, string $attributes = Values::NONE ) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php000064400000005535150364341760017752 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites/' . \rawurlencode($sid) .''; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php000064400000012633150364341760020040 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php000064400000007660150364341760017762 0ustar00options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateInviteOptions ' . $options . ']'; } } class ReadInviteOptions extends Options { /** * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.ReadInviteOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php000064400000011421150364341760020061 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InviteContext Context for this InviteInstance */ protected function proxy(): InviteContext { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php000064400000003140150364341760017316 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php000064400000007402150364341760017716 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members/' . \rawurlencode($sid) .''; } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php000064400000007362150364341760020100 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Attributes' => $options['attributes'], ]); $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) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php000064400000003132150364341760017142 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php000064400000016412150364341760017206 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members'; } /** * Create the MemberInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/services). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * @param array|Options $options Optional Arguments * @return MemberInstance Created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid The Twilio-provided string that uniquely identifies the Member resource to delete. */ public function getContext( string $sid ): MemberContext { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.MemberList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php000064400000016753150364341760017736 0ustar00options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateMemberOptions ' . $options . ']'; } } class ReadMemberOptions extends Options { /** * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.ReadMemberOptions ' . $options . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). * * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php000064400000016240150364341760017362 0ustar00solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages'; } /** * Create the MessageInstance * * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $body, array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $body, 'From' => $options['from'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The Twilio-provided string that uniquely identifies the Message resource to delete. */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.MessageList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php000064400000012722150364341760020214 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php000064400000003132150364341760017171 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php000064400000014266150364341760016515 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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 invites */ protected function getInvites(): InviteList { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RolePage.php000064400000003037150364341760015270 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceOptions.php000064400000173667150364341760015167 0ustar00options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string[] $webhookFilters The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setWebhookFilters(array $webhookFilters): self { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. * * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageSendUrl(string $webhooksOnMessageSendUrl): self { $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_send.url`. * * @param string $webhooksOnMessageSendMethod The HTTP method to use when calling the `webhooks.on_message_send.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageSendMethod(string $webhooksOnMessageSendMethod): self { $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. * * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateUrl(string $webhooksOnMessageUpdateUrl): self { $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_update.url`. * * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when calling the `webhooks.on_message_update.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateMethod(string $webhooksOnMessageUpdateMethod): self { $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. * * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveUrl(string $webhooksOnMessageRemoveUrl): self { $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_remove.url`. * * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when calling the `webhooks.on_message_remove.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveMethod(string $webhooksOnMessageRemoveMethod): self { $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. * * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelAddUrl(string $webhooksOnChannelAddUrl): self { $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_add.url`. * * @param string $webhooksOnChannelAddMethod The HTTP method to use when calling the `webhooks.on_channel_add.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelAddMethod(string $webhooksOnChannelAddMethod): self { $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. * * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyUrl(string $webhooksOnChannelDestroyUrl): self { $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. * * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyMethod(string $webhooksOnChannelDestroyMethod): self { $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. * * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateUrl(string $webhooksOnChannelUpdateUrl): self { $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_update.url`. * * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when calling the `webhooks.on_channel_update.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateMethod(string $webhooksOnChannelUpdateMethod): self { $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. * * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMemberAddUrl(string $webhooksOnMemberAddUrl): self { $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_add.url`. * * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling the `webhooks.on_member_add.url`. * @return $this Fluent Builder */ public function setWebhooksOnMemberAddMethod(string $webhooksOnMemberAddMethod): self { $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. * * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveUrl(string $webhooksOnMemberRemoveUrl): self { $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_remove.url`. * * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when calling the `webhooks.on_member_remove.url`. * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveMethod(string $webhooksOnMemberRemoveMethod): self { $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. * * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageSentUrl(string $webhooksOnMessageSentUrl): self { $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; return $this; } /** * The URL of the webhook to call in response to the `on_message_sent` event`. * * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in response to the `on_message_sent` event`. * @return $this Fluent Builder */ public function setWebhooksOnMessageSentMethod(string $webhooksOnMessageSentMethod): self { $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. * * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedUrl(string $webhooksOnMessageUpdatedUrl): self { $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_updated.url`. * * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when calling the `webhooks.on_message_updated.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedMethod(string $webhooksOnMessageUpdatedMethod): self { $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. * * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedUrl(string $webhooksOnMessageRemovedUrl): self { $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_removed.url`. * * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when calling the `webhooks.on_message_removed.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedMethod(string $webhooksOnMessageRemovedMethod): self { $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. * * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedUrl(string $webhooksOnChannelAddedUrl): self { $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event`. * * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call in response to the `on_channel_added` event`. * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedMethod(string $webhooksOnChannelAddedMethod): self { $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. * * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedUrl(string $webhooksOnChannelDestroyedUrl): self { $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. * * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedMethod(string $webhooksOnChannelDestroyedMethod): self { $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * * @param string $webhooksOnChannelUpdatedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedUrl(string $webhooksOnChannelUpdatedUrl): self { $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedMethod(string $webhooksOnChannelUpdatedMethod): self { $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedUrl(string $webhooksOnMemberAddedUrl): self { $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * * @param string $webhooksOnMemberAddedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedMethod(string $webhooksOnMemberAddedMethod): self { $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. * * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedUrl(string $webhooksOnMemberRemovedUrl): self { $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_removed.url`. * * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when calling the `webhooks.on_member_removed.url`. * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedMethod(string $webhooksOnMemberRemovedMethod): self { $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; return $this; } /** * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * @return $this Fluent Builder */ public function setLimitsChannelMembers(int $limitsChannelMembers): self { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * @return $this Fluent Builder */ public function setLimitsUserChannels(int $limitsUserChannels): self { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialList.php000064400000014441150364341760015101 0ustar00solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceList.php000064400000013421150364341760014424 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Chat/V1/ServicePage.php000064400000003002150364341760014357 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialOptions.php000064400000034355150364341760015627 0ustar00options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialInstance.php000064400000010775150364341760015740 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceContext.php000064400000025742150364341760015146 0ustar00solution = [ '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'], '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) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialPage.php000064400000003024150364341760015035 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceInstance.php000064400000015347150364341760015266 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'webhooks' => Values::array_get($payload, 'webhooks'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'notifications' => Values::array_get($payload, 'notifications'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the channels */ protected function getChannels(): ChannelList { return $this->proxy()->channels; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialContext.php000064400000006537150364341760015621 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1.php000064400000005051150364341760013112 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkList.php000064400000014507150364341760015057 0ustar00solution = [ ]; $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 ); } /** * Reads TrunkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrunkInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TrunkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrunkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrunkPage Page of TrunkInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrunkPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrunkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrunkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrunkPage Page of TrunkInstance */ public function getPage(string $targetUrl): TrunkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrunkPage($this->version, $response, $this->solution); } /** * Constructs a TrunkContext * * @param string $sid The unique string that we created to identify the Trunk resource to delete. */ public function getContext( string $sid ): TrunkContext { return new TrunkContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.TrunkList]'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkPage.php000064400000003006150364341760015010 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php000064400000010435150364341760020612 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialListContext Context for this CredentialListInstance */ protected function proxy(): CredentialListContext { if (!$this->context) { $this->context = new CredentialListContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.CredentialListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php000064400000003123150364341760017232 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php000064400000014671150364341760020134 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'links' => Values::array_get($payload, 'links'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'url' => Values::array_get($payload, 'url'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), ]; $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the PhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingInstance.php000064400000007013150364341760017616 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php000064400000005412150364341760017477 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php000064400000003145150364341760017722 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php000064400000005041150364341760020003 0ustar00solution = [ 'trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/PhoneNumbers/' . \rawurlencode($sid) .''; } /** * Delete the PhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['trunkSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php000064400000014361150364341760017277 0ustar00solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/PhoneNumbers'; } /** * Create the PhoneNumberInstance * * @param string $phoneNumberSid The SID of the [Incoming Phone Number](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) that you want to associate with the trunk. * @return PhoneNumberInstance Created PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumberSid): PhoneNumberInstance { $data = Values::of([ 'PhoneNumberSid' => $phoneNumberSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PhoneNumberInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Reads PhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PhoneNumberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PhoneNumberPage Page of PhoneNumberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PhoneNumberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PhoneNumberPage Page of PhoneNumberInstance */ public function getPage(string $targetUrl): PhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a PhoneNumberContext * * @param string $sid The unique string that we created to identify the PhoneNumber resource to delete. */ public function getContext( string $sid ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $this->solution['trunkSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php000064400000007166150364341760020540 0ustar00solution = [ 'trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/OriginationUrls/' . \rawurlencode($sid) .''; } /** * Delete the OriginationUrlInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingOptions.php000064400000004020150364341760017500 0ustar00options['mode'] = $mode; $this->options['trim'] = $trim; } /** * @param string $mode * @return $this Fluent Builder */ public function setMode(string $mode): self { $this->options['mode'] = $mode; return $this; } /** * @param string $trim * @return $this Fluent Builder */ public function setTrim(string $trim): self { $this->options['trim'] = $trim; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trunking.V1.UpdateRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php000064400000014754150364341760020752 0ustar00solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/IpAccessControlLists'; } /** * Create the IpAccessControlListInstance * * @param string $ipAccessControlListSid The SID of the [IP Access Control List](https://www.twilio.com/docs/voice/sip/api/sip-ipaccesscontrollist-resource) that you want to associate with the trunk. * @return IpAccessControlListInstance Created IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $ipAccessControlListSid): IpAccessControlListInstance { $data = Values::of([ 'IpAccessControlListSid' => $ipAccessControlListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Reads IpAccessControlListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpAccessControlListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpAccessControlListPage Page of IpAccessControlListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpAccessControlListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpAccessControlListPage Page of IpAccessControlListInstance */ public function getPage(string $targetUrl): IpAccessControlListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Constructs a IpAccessControlListContext * * @param string $sid The unique string that we created to identify the IpAccessControlList resource to delete. */ public function getContext( string $sid ): IpAccessControlListContext { return new IpAccessControlListContext( $this->version, $this->solution['trunkSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.IpAccessControlListList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php000064400000003203150364341760020676 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php000064400000014427150364341760020545 0ustar00options['weight'] = $weight; $this->options['priority'] = $priority; $this->options['enabled'] = $enabled; $this->options['friendlyName'] = $friendlyName; $this->options['sipUrl'] = $sipUrl; } /** * The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * @return $this Fluent Builder */ public function setWeight(int $weight): self { $this->options['weight'] = $weight; return $this; } /** * The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * Whether the URL is enabled. The default is `true`. * * @param bool $enabled Whether the URL is enabled. The default is `true`. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. * * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. * @return $this Fluent Builder */ public function setSipUrl(string $sipUrl): self { $this->options['sipUrl'] = $sipUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trunking.V1.UpdateOriginationUrlOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingPage.php000064400000003107150364341760016726 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php000064400000010545150364341760021575 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpAccessControlListContext Context for this IpAccessControlListInstance */ protected function proxy(): IpAccessControlListContext { if (!$this->context) { $this->context = new IpAccessControlListContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php000064400000012052150364341760020646 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'weight' => Values::array_get($payload, 'weight'), 'enabled' => Values::array_get($payload, 'enabled'), 'sipUrl' => Values::array_get($payload, 'sip_url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'priority' => Values::array_get($payload, 'priority'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return OriginationUrlContext Context for this OriginationUrlInstance */ protected function proxy(): OriginationUrlContext { if (!$this->context) { $this->context = new OriginationUrlContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the OriginationUrlInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the OriginationUrlInstance * * @return OriginationUrlInstance Fetched OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OriginationUrlInstance { return $this->proxy()->fetch(); } /** * Update the OriginationUrlInstance * * @param array|Options $options Optional Arguments * @return OriginationUrlInstance Updated OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): OriginationUrlInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.OriginationUrlInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php000064400000003145150364341760017761 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php000064400000014620150364341760017761 0ustar00solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/CredentialLists'; } /** * Create the CredentialListInstance * * @param string $credentialListSid The SID of the [Credential List](https://www.twilio.com/docs/voice/sip/api/sip-credentiallist-resource) that you want to associate with the trunk. Once associated, we will authenticate access to the trunk against this list. * @return CredentialListInstance Created CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentialListSid): CredentialListInstance { $data = Values::of([ 'CredentialListSid' => $credentialListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Reads CredentialListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialListPage Page of CredentialListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialListPage Page of CredentialListInstance */ public function getPage(string $targetUrl): CredentialListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListPage($this->version, $response, $this->solution); } /** * Constructs a CredentialListContext * * @param string $sid The unique string that we created to identify the CredentialList resource to delete. */ public function getContext( string $sid ): CredentialListContext { return new CredentialListContext( $this->version, $this->solution['trunkSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.CredentialListList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php000064400000005105150364341760020470 0ustar00solution = [ 'trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/CredentialLists/' . \rawurlencode($sid) .''; } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php000064400000005203150364341760021450 0ustar00solution = [ 'trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/IpAccessControlLists/' . \rawurlencode($sid) .''; } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingList.php000064400000003066150364341760016771 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php000064400000016362150364341760020025 0ustar00solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/OriginationUrls'; } /** * Create the OriginationUrlInstance * * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * @param bool $enabled Whether the URL is enabled. The default is `true`. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. * @return OriginationUrlInstance Created OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function create(int $weight, int $priority, bool $enabled, string $friendlyName, string $sipUrl): OriginationUrlInstance { $data = Values::of([ 'Weight' => $weight, 'Priority' => $priority, 'Enabled' => Serialize::booleanToString($enabled), 'FriendlyName' => $friendlyName, 'SipUrl' => $sipUrl, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new OriginationUrlInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Reads OriginationUrlInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return OriginationUrlInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams OriginationUrlInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of OriginationUrlInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return OriginationUrlPage Page of OriginationUrlInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): OriginationUrlPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new OriginationUrlPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of OriginationUrlInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return OriginationUrlPage Page of OriginationUrlInstance */ public function getPage(string $targetUrl): OriginationUrlPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new OriginationUrlPage($this->version, $response, $this->solution); } /** * Constructs a OriginationUrlContext * * @param string $sid The unique string that we created to identify the OriginationUrl resource to delete. */ public function getContext( string $sid ): OriginationUrlContext { return new OriginationUrlContext( $this->version, $this->solution['trunkSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.OriginationUrlList]'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkContext.php000064400000017021150364341760015562 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($sid) .''; } /** * Delete the TrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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 ipAccessControlLists */ protected function getIpAccessControlLists(): IpAccessControlListList { if (!$this->_ipAccessControlLists) { $this->_ipAccessControlLists = new IpAccessControlListList( $this->version, $this->solution['sid'] ); } return $this->_ipAccessControlLists; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList( $this->version, $this->solution['sid'] ); } return $this->_phoneNumbers; } /** * Access the credentialsLists */ protected function getCredentialsLists(): CredentialListList { if (!$this->_credentialsLists) { $this->_credentialsLists = new CredentialListList( $this->version, $this->solution['sid'] ); } return $this->_credentialsLists; } /** * Access the originationUrls */ protected function getOriginationUrls(): OriginationUrlList { if (!$this->_originationUrls) { $this->_originationUrls = new OriginationUrlList( $this->version, $this->solution['sid'] ); } return $this->_originationUrls; } /** * Access the recordings */ protected function getRecordings(): RecordingList { if (!$this->_recordings) { $this->_recordings = new RecordingList( $this->version, $this->solution['sid'] ); } return $this->_recordings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.TrunkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkInstance.php000064400000015365150364341760015713 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'domainName' => Values::array_get($payload, 'domain_name'), 'disasterRecoveryMethod' => Values::array_get($payload, 'disaster_recovery_method'), 'disasterRecoveryUrl' => Values::array_get($payload, 'disaster_recovery_url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'secure' => Values::array_get($payload, 'secure'), 'recording' => Values::array_get($payload, 'recording'), 'transferMode' => Values::array_get($payload, 'transfer_mode'), 'transferCallerId' => Values::array_get($payload, 'transfer_caller_id'), 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), 'authType' => Values::array_get($payload, 'auth_type'), 'authTypeSet' => Values::array_get($payload, 'auth_type_set'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrunkContext Context for this TrunkInstance */ protected function proxy(): TrunkContext { if (!$this->context) { $this->context = new TrunkContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the TrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { return $this->proxy()->fetch(); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrunkInstance { return $this->proxy()->update($options); } /** * Access the ipAccessControlLists */ protected function getIpAccessControlLists(): IpAccessControlListList { return $this->proxy()->ipAccessControlLists; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { return $this->proxy()->phoneNumbers; } /** * Access the credentialsLists */ protected function getCredentialsLists(): CredentialListList { return $this->proxy()->credentialsLists; } /** * Access the originationUrls */ protected function getOriginationUrls(): OriginationUrlList { return $this->proxy()->originationUrls; } /** * Access the recordings */ protected function getRecordings(): RecordingList { return $this->proxy()->recordings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.TrunkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkOptions.php000064400000052206150364341760015575 0ustar00options['friendlyName'] = $friendlyName; $this->options['domainName'] = $domainName; $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; $this->options['transferMode'] = $transferMode; $this->options['secure'] = $secure; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; $this->options['transferCallerId'] = $transferCallerId; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @return $this Fluent Builder */ public function setDomainName(string $domainName): self { $this->options['domainName'] = $domainName; return $this; } /** * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @return $this Fluent Builder */ public function setDisasterRecoveryUrl(string $disasterRecoveryUrl): self { $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; return $this; } /** * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * @param string $transferMode * @return $this Fluent Builder */ public function setTransferMode(string $transferMode): self { $this->options['transferMode'] = $transferMode; return $this; } /** * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @return $this Fluent Builder */ public function setSecure(bool $secure): self { $this->options['secure'] = $secure; return $this; } /** * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * @param string $transferCallerId * @return $this Fluent Builder */ public function setTransferCallerId(string $transferCallerId): self { $this->options['transferCallerId'] = $transferCallerId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trunking.V1.CreateTrunkOptions ' . $options . ']'; } } class UpdateTrunkOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @param string $transferMode * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $transferCallerId */ public function __construct( string $friendlyName = Values::NONE, string $domainName = Values::NONE, string $disasterRecoveryUrl = Values::NONE, string $disasterRecoveryMethod = Values::NONE, string $transferMode = Values::NONE, bool $secure = Values::BOOL_NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $transferCallerId = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['domainName'] = $domainName; $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; $this->options['transferMode'] = $transferMode; $this->options['secure'] = $secure; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; $this->options['transferCallerId'] = $transferCallerId; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @return $this Fluent Builder */ public function setDomainName(string $domainName): self { $this->options['domainName'] = $domainName; return $this; } /** * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @return $this Fluent Builder */ public function setDisasterRecoveryUrl(string $disasterRecoveryUrl): self { $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; return $this; } /** * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * @param string $transferMode * @return $this Fluent Builder */ public function setTransferMode(string $transferMode): self { $this->options['transferMode'] = $transferMode; return $this; } /** * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @return $this Fluent Builder */ public function setSecure(bool $secure): self { $this->options['secure'] = $secure; return $this; } /** * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * @param string $transferCallerId * @return $this Fluent Builder */ public function setTransferCallerId(string $transferCallerId): self { $this->options['transferCallerId'] = $transferCallerId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trunking.V1.UpdateTrunkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Microvisor.php000064400000002373150364341760013163 0ustar00apps instead. */ protected function getApps(): \Twilio\Rest\Microvisor\V1\AppList { echo "apps is deprecated. Use v1->apps instead."; return $this->v1->apps; } /** * @deprecated Use v1->apps(\$sid) instead. * @param string $sid A string that uniquely identifies this App. */ protected function contextApps(string $sid): \Twilio\Rest\Microvisor\V1\AppContext { echo "apps(\$sid) is deprecated. Use v1->apps(\$sid) instead."; return $this->v1->apps($sid); } /** * @deprecated Use v1->devices instead. */ protected function getDevices(): \Twilio\Rest\Microvisor\V1\DeviceList { echo "devices is deprecated. Use v1->devices instead."; return $this->v1->devices; } /** * @deprecated Use v1->devices(\$sid) instead. * @param string $sid A string that uniquely identifies this Device. */ protected function contextDevices(string $sid): \Twilio\Rest\Microvisor\V1\DeviceContext { echo "devices(\$sid) is deprecated. Use v1->devices(\$sid) instead."; return $this->v1->devices($sid); } }sdk/src/Twilio/Rest/Preview/Wireless.php000064400000006461150364341760014247 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices.php000064400000005161150364341760015516 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Preview/Understand.php000064400000005203150364341760014552 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php000064400000015004150364341760022305 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'verificationAttempts' => Values::array_get($payload, 'verification_attempts'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'url' => Values::array_get($payload, 'url'), 'verificationType' => Values::array_get($payload, 'verification_type'), 'verificationDocumentSid' => Values::array_get($payload, 'verification_document_sid'), 'extension' => Values::array_get($payload, 'extension'), 'callDelay' => Values::array_get($payload, 'call_delay'), 'verificationCode' => Values::array_get($payload, 'verification_code'), 'verificationCallSids' => Values::array_get($payload, 'verification_call_sids'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return HostedNumberOrderContext Context for this HostedNumberOrderInstance */ protected function proxy(): HostedNumberOrderContext { if (!$this->context) { $this->context = new HostedNumberOrderContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the HostedNumberOrderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the HostedNumberOrderInstance * * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): HostedNumberOrderInstance { return $this->proxy()->fetch(); } /** * Update the HostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): HostedNumberOrderInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.HostedNumberOrderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php000064400000012265150364341760023137 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php000064400000074655150364341760022215 0ustar00options['accountSid'] = $accountSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['ccEmails'] = $ccEmails; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['addressSid'] = $addressSid; $this->options['email'] = $email; $this->options['verificationType'] = $verificationType; $this->options['verificationDocumentSid'] = $verificationDocumentSid; } /** * This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * * @param string $accountSid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * A 64 character string that is a human readable text that describes this resource. * * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * * @param string[] $ccEmails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsUrl The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsMethod The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsFallbackUrl A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsFallbackMethod The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * * @param string $statusCallbackUrl Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setStatusCallbackUrl(string $statusCallbackUrl): self { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * * @param string $statusCallbackMethod Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * * @param string $smsApplicationSid Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. * * @param string $addressSid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * Optional. Email of the owner of this phone number that is being hosted. * * @param string $email Optional. Email of the owner of this phone number that is being hosted. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * @param string $verificationType * @return $this Fluent Builder */ public function setVerificationType(string $verificationType): self { $this->options['verificationType'] = $verificationType; return $this; } /** * Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * @return $this Fluent Builder */ public function setVerificationDocumentSid(string $verificationDocumentSid): self { $this->options['verificationDocumentSid'] = $verificationDocumentSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.CreateHostedNumberOrderOptions ' . $options . ']'; } } class ReadHostedNumberOrderOptions extends Options { /** * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ public function __construct( string $status = Values::NONE, string $phoneNumber = Values::NONE, string $incomingPhoneNumberSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE ) { $this->options['status'] = $status; $this->options['phoneNumber'] = $phoneNumber; $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * An E164 formatted phone number hosted by this HostedNumberOrder. * * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @return $this Fluent Builder */ public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self { $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.ReadHostedNumberOrderOptions ' . $options . ']'; } } class UpdateHostedNumberOrderOptions extends Options { /** * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @param string $email Email of the owner of this phone number that is being hosted. * @param string[] $ccEmails Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. * @param string $status * @param string $verificationCode A verification code that is given to the user via a phone call to the phone number that is being hosted. * @param string $verificationType * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * @param string $extension Digits to dial after connecting the verification call. * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $email = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $status = Values::NONE, string $verificationCode = Values::NONE, string $verificationType = Values::NONE, string $verificationDocumentSid = Values::NONE, string $extension = Values::NONE, int $callDelay = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['email'] = $email; $this->options['ccEmails'] = $ccEmails; $this->options['status'] = $status; $this->options['verificationCode'] = $verificationCode; $this->options['verificationType'] = $verificationType; $this->options['verificationDocumentSid'] = $verificationDocumentSid; $this->options['extension'] = $extension; $this->options['callDelay'] = $callDelay; } /** * A 64 character string that is a human readable text that describes this resource. * * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Email of the owner of this phone number that is being hosted. * * @param string $email Email of the owner of this phone number that is being hosted. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. * * @param string[] $ccEmails Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * A verification code that is given to the user via a phone call to the phone number that is being hosted. * * @param string $verificationCode A verification code that is given to the user via a phone call to the phone number that is being hosted. * @return $this Fluent Builder */ public function setVerificationCode(string $verificationCode): self { $this->options['verificationCode'] = $verificationCode; return $this; } /** * @param string $verificationType * @return $this Fluent Builder */ public function setVerificationType(string $verificationType): self { $this->options['verificationType'] = $verificationType; return $this; } /** * Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * @return $this Fluent Builder */ public function setVerificationDocumentSid(string $verificationDocumentSid): self { $this->options['verificationDocumentSid'] = $verificationDocumentSid; return $this; } /** * Digits to dial after connecting the verification call. * * @param string $extension Digits to dial after connecting the verification call. * @return $this Fluent Builder */ public function setExtension(string $extension): self { $this->options['extension'] = $extension; return $this; } /** * The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. * * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. * @return $this Fluent Builder */ public function setCallDelay(int $callDelay): self { $this->options['callDelay'] = $callDelay; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.UpdateHostedNumberOrderOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php000064400000017263150364341760022431 0ustar00solution = [ ]; $this->uri = '/AuthorizationDocuments'; } /** * Create the AuthorizationDocumentInstance * * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Created AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $hostedNumberOrderSids, string $addressSid, string $email, string $contactTitle, string $contactPhoneNumber, array $options = []): AuthorizationDocumentInstance { $options = new Values($options); $data = Values::of([ 'HostedNumberOrderSids' => Serialize::map($hostedNumberOrderSids,function ($e) { return $e; }), 'AddressSid' => $addressSid, 'Email' => $email, 'ContactTitle' => $contactTitle, 'ContactPhoneNumber' => $contactPhoneNumber, 'CcEmails' => Serialize::map($options['ccEmails'], function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthorizationDocumentInstance( $this->version, $payload ); } /** * Reads AuthorizationDocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthorizationDocumentInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AuthorizationDocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthorizationDocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthorizationDocumentPage Page of AuthorizationDocumentInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthorizationDocumentPage { $options = new Values($options); $params = Values::of([ 'Email' => $options['email'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthorizationDocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthorizationDocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthorizationDocumentPage Page of AuthorizationDocumentInstance */ public function getPage(string $targetUrl): AuthorizationDocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthorizationDocumentPage($this->version, $response, $this->solution); } /** * Constructs a AuthorizationDocumentContext * * @param string $sid A 34 character string that uniquely identifies this AuthorizationDocument. */ public function getContext( string $sid ): AuthorizationDocumentContext { return new AuthorizationDocumentContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentList]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php000064400000014046150364341760027647 0ustar00solution = [ 'signingDocumentSid' => $signingDocumentSid, ]; $this->uri = '/AuthorizationDocuments/' . \rawurlencode($signingDocumentSid) .'/DependentHostedNumberOrders'; } /** * Reads DependentHostedNumberOrderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DependentHostedNumberOrderInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams DependentHostedNumberOrderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DependentHostedNumberOrderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DependentHostedNumberOrderPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'PhoneNumber' => $options['phoneNumber'], 'IncomingPhoneNumberSid' => $options['incomingPhoneNumberSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DependentHostedNumberOrderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance */ public function getPage(string $targetUrl): DependentHostedNumberOrderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderList]'; } } src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php000064400000011545150364341760030422 0ustar00sdkproperties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'verificationAttempts' => Values::array_get($payload, 'verification_attempts'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'verificationType' => Values::array_get($payload, 'verification_type'), 'verificationDocumentSid' => Values::array_get($payload, 'verification_document_sid'), 'extension' => Values::array_get($payload, 'extension'), 'callDelay' => Values::array_get($payload, 'call_delay'), 'verificationCode' => Values::array_get($payload, 'verification_code'), 'verificationCallSids' => Values::array_get($payload, 'verification_call_sids'), ]; $this->solution = ['signingDocumentSid' => $signingDocumentSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderInstance]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php000064400000003364150364341760027611 0ustar00solution = $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]'; } } src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php000064400000015304150364341760030306 0ustar00sdkoptions['status'] = $status; $this->options['phoneNumber'] = $phoneNumber; $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * An E164 formatted phone number hosted by this HostedNumberOrder. * * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @return $this Fluent Builder */ public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self { $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.ReadDependentHostedNumberOrderOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php000064400000011543150364341760023255 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php000064400000027320150364341760023144 0ustar00options['ccEmails'] = $ccEmails; } /** * Email recipients who will be informed when an Authorization Document has been sent and signed. * * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.CreateAuthorizationDocumentOptions ' . $options . ']'; } } class ReadAuthorizationDocumentOptions extends Options { /** * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ public function __construct( string $email = Values::NONE, string $status = Values::NONE ) { $this->options['email'] = $email; $this->options['status'] = $status; } /** * Email that this AuthorizationDocument will be sent to for signing. * * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.ReadAuthorizationDocumentOptions ' . $options . ']'; } } class UpdateAuthorizationDocumentOptions extends Options { /** * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed * @param string $status * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. */ public function __construct( array $hostedNumberOrderSids = Values::ARRAY_NONE, string $addressSid = Values::NONE, string $email = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $status = Values::NONE, string $contactTitle = Values::NONE, string $contactPhoneNumber = Values::NONE ) { $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; $this->options['addressSid'] = $addressSid; $this->options['email'] = $email; $this->options['ccEmails'] = $ccEmails; $this->options['status'] = $status; $this->options['contactTitle'] = $contactTitle; $this->options['contactPhoneNumber'] = $contactPhoneNumber; } /** * A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * @return $this Fluent Builder */ public function setHostedNumberOrderSids(array $hostedNumberOrderSids): self { $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; return $this; } /** * A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * Email that this AuthorizationDocument will be sent to for signing. * * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Email recipients who will be informed when an Authorization Document has been sent and signed * * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The title of the person authorized to sign the Authorization Document for this phone number. * * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @return $this Fluent Builder */ public function setContactTitle(string $contactTitle): self { $this->options['contactTitle'] = $contactTitle; return $this; } /** * The contact phone number of the person authorized to sign the Authorization Document. * * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. * @return $this Fluent Builder */ public function setContactPhoneNumber(string $contactPhoneNumber): self { $this->options['contactPhoneNumber'] = $contactPhoneNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.UpdateAuthorizationDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php000064400000007445150364341760022177 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/HostedNumberOrders/' . \rawurlencode($sid) .''; } /** * Delete the HostedNumberOrderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php000064400000020141150364341760021452 0ustar00solution = [ ]; $this->uri = '/HostedNumberOrders'; } /** * Create the HostedNumberOrderInstance * * @param string $phoneNumber The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format * @param bool $smsCapability Used to specify that the SMS capability will be hosted on Twilio's platform. * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Created HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, bool $smsCapability, array $options = []): HostedNumberOrderInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'SmsCapability' => Serialize::booleanToString($smsCapability), 'AccountSid' => $options['accountSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'CcEmails' => Serialize::map($options['ccEmails'], function ($e) { return $e; }), 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'StatusCallbackUrl' => $options['statusCallbackUrl'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'AddressSid' => $options['addressSid'], 'Email' => $options['email'], 'VerificationType' => $options['verificationType'], 'VerificationDocumentSid' => $options['verificationDocumentSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new HostedNumberOrderInstance( $this->version, $payload ); } /** * Reads HostedNumberOrderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return HostedNumberOrderInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams HostedNumberOrderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return HostedNumberOrderPage Page of HostedNumberOrderInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): HostedNumberOrderPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'PhoneNumber' => $options['phoneNumber'], 'IncomingPhoneNumberSid' => $options['incomingPhoneNumberSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new HostedNumberOrderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return HostedNumberOrderPage Page of HostedNumberOrderInstance */ public function getPage(string $targetUrl): HostedNumberOrderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new HostedNumberOrderPage($this->version, $response, $this->solution); } /** * Constructs a HostedNumberOrderContext * * @param string $sid A 34 character string that uniquely identifies this HostedNumberOrder. */ public function getContext( string $sid ): HostedNumberOrderContext { return new HostedNumberOrderContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.HostedNumberOrderList]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php000064400000003153150364341760021417 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php000064400000003203150364341760022357 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync.php000064400000005107150364341760013362 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantContext.php000064400000022451150364341760020074 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($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); } /** * 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'] ); } /** * Access the fieldTypes */ protected function getFieldTypes(): FieldTypeList { if (!$this->_fieldTypes) { $this->_fieldTypes = new FieldTypeList( $this->version, $this->solution['sid'] ); } return $this->_fieldTypes; } /** * Access the queries */ protected function getQueries(): QueryList { if (!$this->_queries) { $this->_queries = new QueryList( $this->version, $this->solution['sid'] ); } return $this->_queries; } /** * 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 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 styleSheet */ protected function getStyleSheet(): StyleSheetList { if (!$this->_styleSheet) { $this->_styleSheet = new StyleSheetList( $this->version, $this->solution['sid'] ); } return $this->_styleSheet; } /** * Access the dialogues */ protected function getDialogues(): DialogueList { if (!$this->_dialogues) { $this->_dialogues = new DialogueList( $this->version, $this->solution['sid'] ); } return $this->_dialogues; } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantPage.php000064400000003062150364341760017321 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantList.php000064400000014665150364341760017373 0ustar00solution = [ ]; $this->uri = '/Assistants'; } /** * 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 ); } /** * 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); } /** * 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']); } /** * 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); } /** * 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]'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantInstance.php000064400000015775150364341760020227 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * Access the fieldTypes */ protected function getFieldTypes(): FieldTypeList { return $this->proxy()->fieldTypes; } /** * Access the queries */ protected function getQueries(): QueryList { return $this->proxy()->queries; } /** * Access the tasks */ protected function getTasks(): TaskList { return $this->proxy()->tasks; } /** * Access the modelBuilds */ protected function getModelBuilds(): ModelBuildList { return $this->proxy()->modelBuilds; } /** * Access the assistantFallbackActions */ protected function getAssistantFallbackActions(): AssistantFallbackActionsList { return $this->proxy()->assistantFallbackActions; } /** * Access the assistantInitiationActions */ protected function getAssistantInitiationActions(): AssistantInitiationActionsList { return $this->proxy()->assistantInitiationActions; } /** * Access the styleSheet */ protected function getStyleSheet(): StyleSheetList { return $this->proxy()->styleSheet; } /** * Access the dialogues */ protected function getDialogues(): DialogueList { return $this->proxy()->dialogues; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildOptions.php000064400000011000150364341760022107 0ustar00options['statusCallback'] = $statusCallback; $this->options['uniqueName'] = $uniqueName; } /** * * * @param string $statusCallback * @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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryContext.php000064400000006412150364341760021200 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Queries/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeOptions.php000064400000011275150364341760021772 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/DialogueList.php000064400000003135150364341760021112 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; } /** * Constructs a DialogueContext * * @param string $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsContext.php000064400000005717150364341760025014 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsList.php000064400000003165150364341760024276 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsList.php000064400000003201150364341760024675 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetOptions.php000064400000003556150364341760022201 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsInstance.php000064400000007667150364341760025142 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsInstance.php000064400000007725150364341760025545 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskPage.php000064400000003111150364341760020216 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/DialogueInstance.php000064400000007046150364341760021750 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetList.php000064400000003077150364341760021457 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskList.php000064400000014627150364341760020273 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks'; } /** * 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'] ); } /** * 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); } /** * 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']); } /** * 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); } /** * 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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskInstance.php000064400000013414150364341760021115 0ustar00properties = [ '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; } /** * 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(); } /** * Fetch the TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskInstance { return $this->proxy()->fetch(); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskInstance { return $this->proxy()->update($options); } /** * Access the samples */ protected function getSamples(): SampleList { return $this->proxy()->samples; } /** * Access the fields */ protected function getFields(): FieldList { return $this->proxy()->fields; } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetPage.php000064400000003155150364341760021415 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsPage.php000064400000003301150364341760024227 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryInstance.php000064400000012215150364341760021316 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypePage.php000064400000003147150364341760021212 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueInstance.php000064400000011123150364341760024113 0ustar00properties = [ '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; } /** * 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(); } /** * Fetch the FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldValueInstance { 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.FieldValueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValuePage.php000064400000003242150364341760023226 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueList.php000064400000015752150364341760023276 0ustar00solution = [ 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/FieldTypes/' . \rawurlencode($fieldTypeSid) .'/FieldValues'; } /** * 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'] ); } /** * 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); } /** * 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']); } /** * Retrieve a single page of FieldValueInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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); } /** * Constructs a FieldValueContext * * @param string $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueContext.php000064400000005231150364341760023776 0ustar00solution = [ 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/FieldTypes/' . \rawurlencode($fieldTypeSid) .'/FieldValues/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueOptions.php000064400000006721150364341760024012 0ustar00options['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 . ']'; } } 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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildList.php000064400000014177150364341760021411 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/ModelBuilds'; } /** * 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'] ); } /** * 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); } /** * 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']); } /** * 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); } /** * Constructs a ModelBuildContext * * @param string $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsOptions.php000064400000003666150364341760025434 0ustar00options['initiationActions'] = $initiationActions; } /** * * * @param array $initiationActions * @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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildPage.php000064400000003155150364341760021344 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryList.php000064400000015662150364341760020476 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Queries'; } /** * 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'] ); } /** * 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); } /** * 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']); } /** * Retrieve a single page of QueryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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); } /** * 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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskOptions.php000064400000017606150364341760021013 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/DialoguePage.php000064400000003141150364341760021050 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsPage.php000064400000003315150364341760024644 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildContext.php000064400000006267150364341760022123 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/ModelBuilds/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldList.php000064400000015220150364341760021304 0ustar00solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Fields'; } /** * Create the FieldInstance * * @param string $fieldType The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type 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'] ); } /** * 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); } /** * 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']); } /** * 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); } /** * 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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsOptions.php000064400000004001150364341760023217 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsContext.php000064400000004466150364341760023761 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleOptions.php000064400000015643150364341760022233 0ustar00options['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 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 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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsInstance.php000064400000007512150364341760024074 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsList.php000064400000003455150364341760023245 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsPage.php000064400000003231150364341760022444 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsContext.php000064400000006054150364341760023222 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsPage.php000064400000003253150364341760023202 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleList.php000064400000015755150364341760021517 0ustar00solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Samples'; } /** * 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'] ); } /** * 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); } /** * 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']); } /** * Retrieve a single page of SampleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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); } /** * 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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldInstance.php000064400000011053150364341760022135 0ustar00properties = [ '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; } /** * 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(); } /** * Fetch the FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FieldInstance { 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.FieldInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleInstance.php000064400000012025150364341760022333 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleContext.php000064400000007165150364341760022224 0ustar00solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Samples/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SamplePage.php000064400000003173150364341760021447 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldContext.php000064400000005327150364341760022024 0ustar00solution = [ 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Fields/' . \rawurlencode($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); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsList.php000064400000003400150364341760022501 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsInstance.php000064400000010020150364341760023326 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldPage.php000064400000003165150364341760021252 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetContext.php000064400000005450150364341760022165 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/DialogueContext.php000064400000004207150364341760021624 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeInstance.php000064400000011716150364341760022103 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryPage.php000064400000003117150364341760020427 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeList.php000064400000014411150364341760021245 0ustar00solution = [ 'assistantSid' => $assistantSid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/FieldTypes'; } /** * 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'] ); } /** * 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); } /** * 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']); } /** * 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); } /** * Constructs a FieldTypeContext * * @param string $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]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsOptions.php000064400000003622150364341760025014 0ustar00options['fallbackActions'] = $fallbackActions; } /** * * * @param array $fallbackActions * @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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetInstance.php000064400000007403150364341760022305 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryOptions.php000064400000022127150364341760021210 0ustar00options['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 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 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 . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsContext.php000064400000005757150364341760025430 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildInstance.php000064400000011500150364341760022225 0ustar00properties = [ '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; } /** * 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(); } /** * 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); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskContext.php000064400000015605150364341760021001 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/Tasks/' . \rawurlencode($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); } /** * 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'] ); } /** * 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 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 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeContext.php000064400000011771150364341760021764 0ustar00solution = [ 'assistantSid' => $assistantSid, 'sid' => $sid, ]; $this->uri = '/Assistants/' . \rawurlencode($assistantSid) .'/FieldTypes/' . \rawurlencode($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); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantOptions.php000064400000040406150364341760020103 0ustar00options['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::BOOL_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 . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php000064400000003123150364341760020255 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php000064400000003123150364341760020314 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php000064400000014664150364341760020367 0ustar00solution = [ ]; $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 ); } /** * Reads InstalledAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InstalledAddOnInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InstalledAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InstalledAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InstalledAddOnPage Page of InstalledAddOnInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InstalledAddOnPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InstalledAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InstalledAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InstalledAddOnPage Page of InstalledAddOnInstance */ public function getPage(string $targetUrl): InstalledAddOnPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InstalledAddOnPage($this->version, $response, $this->solution); } /** * Constructs a InstalledAddOnContext * * @param string $sid The SID of the InstalledAddOn resource to delete. */ public function getContext( string $sid ): InstalledAddOnContext { return new InstalledAddOnContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.InstalledAddOnList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php000064400000013474150364341760021105 0ustar00options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * The JSON object that represents the configuration of the new Add-on being installed. * * @param array $configuration The JSON object that represents the configuration of the new Add-on being installed. * @return $this Fluent Builder */ public function setConfiguration(array $configuration): self { $this->options['configuration'] = $configuration; return $this; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Marketplace.CreateInstalledAddOnOptions ' . $options . ']'; } } class UpdateInstalledAddOnOptions extends Options { /** * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. */ public function __construct( array $configuration = Values::ARRAY_NONE, string $uniqueName = Values::NONE ) { $this->options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured * * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured * @return $this Fluent Builder */ public function setConfiguration(array $configuration): self { $this->options['configuration'] = $configuration; return $this; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Marketplace.UpdateInstalledAddOnOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php000064400000012333150364341760020317 0ustar00solution = [ ]; $this->uri = '/AvailableAddOns'; } /** * Reads AvailableAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailableAddOnInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AvailableAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AvailableAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AvailableAddOnPage Page of AvailableAddOnInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AvailableAddOnPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AvailableAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailableAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AvailableAddOnPage Page of AvailableAddOnInstance */ public function getPage(string $targetUrl): AvailableAddOnPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailableAddOnPage($this->version, $response, $this->solution); } /** * Constructs a AvailableAddOnContext * * @param string $sid The SID of the AvailableAddOn resource to fetch. */ public function getContext( string $sid ): AvailableAddOnContext { return new AvailableAddOnContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.AvailableAddOnList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php000064400000007432150364341760021034 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php000064400000003315150364341760025041 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php000064400000011015150364341760025725 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php000064400000013344150364341760025103 0ustar00solution = [ 'installedAddOnSid' => $installedAddOnSid, ]; $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) .'/Extensions'; } /** * Reads InstalledAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InstalledAddOnExtensionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InstalledAddOnExtensionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InstalledAddOnExtensionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InstalledAddOnExtensionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InstalledAddOnExtensionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance */ public function getPage(string $targetUrl): InstalledAddOnExtensionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a InstalledAddOnExtensionContext * * @param string $sid The SID of the InstalledAddOn Extension resource to fetch. */ public function getContext( string $sid ): InstalledAddOnExtensionContext { return new InstalledAddOnExtensionContext( $this->version, $this->solution['installedAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php000064400000006323150364341760025613 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php000064400000010026150364341760021145 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php000064400000012075150364341760021212 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php000064400000011633150364341760021071 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php000064400000003315150364341760024743 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php000064400000013344150364341760025005 0ustar00solution = [ 'availableAddOnSid' => $availableAddOnSid, ]; $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) .'/Extensions'; } /** * Reads AvailableAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailableAddOnExtensionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AvailableAddOnExtensionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AvailableAddOnExtensionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AvailableAddOnExtensionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailableAddOnExtensionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance */ public function getPage(string $targetUrl): AvailableAddOnExtensionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a AvailableAddOnExtensionContext * * @param string $sid The SID of the AvailableAddOn Extension resource to fetch. */ public function getContext( string $sid ): AvailableAddOnExtensionContext { return new AvailableAddOnExtensionContext( $this->version, $this->solution['availableAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php000064400000010003150364341760025623 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php000064400000004647150364341760025524 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php000064400000003340150364341760017705 0ustar00options['uniqueName'] = $uniqueName; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.CreateSyncMapOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php000064400000003346150364341760020111 0ustar00options['uniqueName'] = $uniqueName; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.CreateSyncListOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentPage.php000064400000003111150364341760017326 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php000064400000012022150364341760022204 0ustar00properties = [ 'key' => Values::array_get($payload, 'key'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key ?: $this->properties['key'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapItemContext Context for this SyncMapItemInstance */ protected function proxy(): SyncMapItemContext { if (!$this->context) { $this->context = new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } return $this->context; } /** * Delete the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapItemInstance * * @param array $data * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): SyncMapItemInstance { return $this->proxy()->update($data, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php000064400000003252150364341760022553 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php000064400000011664150364341760022106 0ustar00options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.DeleteSyncMapItemOptions ' . $options . ']'; } } class ReadSyncMapItemOptions extends Options { /** * @param string $order * @param string $from * @param string $bounds */ public function __construct( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * * * @param string $order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * * * @param string $bounds * @return $this Fluent Builder */ public function setBounds(string $bounds): self { $this->options['bounds'] = $bounds; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.ReadSyncMapItemOptions ' . $options . ']'; } } class UpdateSyncMapItemOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.UpdateSyncMapItemOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php000064400000012211150364341760023436 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapPermissionContext Context for this SyncMapPermissionInstance */ protected function proxy(): SyncMapPermissionContext { if (!$this->context) { $this->context = new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php000064400000015314150364341760021362 0ustar00solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Items'; } /** * Create the SyncMapItemInstance * * @param string $key * @param array $data * @return SyncMapItemInstance Created SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, array $data): SyncMapItemInstance { $data = Values::of([ 'Key' => $key, 'Data' => Serialize::jsonObject($data), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Reads SyncMapItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapItemInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SyncMapItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapItemPage Page of SyncMapItemInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapItemPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapItemPage Page of SyncMapItemInstance */ public function getPage(string $targetUrl): SyncMapItemPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapItemContext * * @param string $key */ public function getContext( string $key ): SyncMapItemContext { return new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapItemList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php000064400000013443150364341760022615 0ustar00solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions'; } /** * Reads SyncMapPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncMapPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapPermissionPage Page of SyncMapPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapPermissionPage Page of SyncMapPermissionInstance */ public function getPage(string $targetUrl): SyncMapPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapPermissionContext * * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function getContext( string $identity ): SyncMapPermissionContext { return new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php000064400000010042150364341760023316 0ustar00solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the SyncMapPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php000064400000007323150364341760022074 0ustar00solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Items/' . \rawurlencode($key) .''; } /** * Delete the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Update the SyncMapItemInstance * * @param array $data * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): SyncMapItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php000064400000003206150364341760021320 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php000064400000011553150364341760020101 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($sid) .''; } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { if (!$this->_syncListPermissions) { $this->_syncListPermissions = new SyncListPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListPermissions; } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { if (!$this->_syncListItems) { $this->_syncListItems = new SyncListItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListItems; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php000064400000012254150364341760020226 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DocumentContext Context for this DocumentInstance */ protected function proxy(): DocumentContext { if (!$this->context) { $this->context = new DocumentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { return $this->proxy()->fetch(); } /** * Update the DocumentInstance * * @param array $data * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): DocumentInstance { return $this->proxy()->update($data, $options); } /** * Access the documentPermissions */ protected function getDocumentPermissions(): DocumentPermissionList { return $this->proxy()->documentPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php000064400000012152150364341760020103 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($sid) .''; } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the DocumentInstance * * @param array $data * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): DocumentInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListList.php000064400000013737150364341760017376 0ustar00solution = [ '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'] ); } /** * Reads SyncListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListPage Page of SyncListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListPage Page of SyncListInstance */ public function getPage(string $targetUrl): SyncListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPage($this->version, $response, $this->solution); } /** * Constructs a SyncListContext * * @param string $sid */ public function getContext( string $sid ): SyncListContext { return new SyncListContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php000064400000011660150364341760020220 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListContext Context for this SyncListInstance */ protected function proxy(): SyncListContext { if (!$this->context) { $this->context = new SyncListContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { return $this->proxy()->fetch(); } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { return $this->proxy()->syncListPermissions; } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { return $this->proxy()->syncListItems; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php000064400000007365150364341760022476 0ustar00solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Items/' . \rawurlencode($index) .''; } /** * Delete the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Update the SyncListItemInstance * * @param array $data * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): SyncListItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php000064400000010075150364341760023720 0ustar00solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the SyncListPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync List. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync List. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php000064400000012246150364341760024042 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListPermissionContext Context for this SyncListPermissionInstance */ protected function proxy(): SyncListPermissionContext { if (!$this->context) { $this->context = new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { return $this->proxy()->fetch(); } /** * Update the SyncListPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync List. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync List. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php000064400000011705150364341760022476 0ustar00options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.DeleteSyncListItemOptions ' . $options . ']'; } } class ReadSyncListItemOptions extends Options { /** * @param string $order * @param string $from * @param string $bounds */ public function __construct( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * * * @param string $order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * * * @param string $bounds * @return $this Fluent Builder */ public function setBounds(string $bounds): self { $this->options['bounds'] = $bounds; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.ReadSyncListItemOptions ' . $options . ']'; } } class UpdateSyncListItemOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.UpdateSyncListItemOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php000064400000013477150364341760023220 0ustar00solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Permissions'; } /** * Reads SyncListPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncListPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListPermissionPage Page of SyncListPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListPermissionPage Page of SyncListPermissionInstance */ public function getPage(string $targetUrl): SyncListPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncListPermissionContext * * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function getContext( string $identity ): SyncListPermissionContext { return new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php000064400000003263150364341760023151 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php000064400000012064150364341760022606 0ustar00properties = [ 'index' => Values::array_get($payload, 'index'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index ?: $this->properties['index'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListItemContext Context for this SyncListItemInstance */ protected function proxy(): SyncListItemContext { if (!$this->context) { $this->context = new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } return $this->context; } /** * Delete the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { return $this->proxy()->fetch(); } /** * Update the SyncListItemInstance * * @param array $data * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): SyncListItemInstance { return $this->proxy()->update($data, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php000064400000003217150364341760021716 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php000064400000015232150364341760021755 0ustar00solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Items'; } /** * Create the SyncListItemInstance * * @param array $data * @return SyncListItemInstance Created SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $data): SyncListItemInstance { $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Reads SyncListItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListItemInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SyncListItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListItemInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListItemPage Page of SyncListItemInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListItemPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListItemPage Page of SyncListItemInstance */ public function getPage(string $targetUrl): SyncListItemPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncListItemContext * * @param int $index */ public function getContext( int $index ): SyncListItemContext { return new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $index ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListItemList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php000064400000006520150364341760020114 0ustar00options['uniqueName'] = $uniqueName; $this->options['data'] = $data; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param array $data * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.CreateDocumentOptions ' . $options . ']'; } } class UpdateDocumentOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.UpdateDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListPage.php000064400000003111150364341760017320 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php000064400000011501150364341760017674 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($sid) .''; } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php000064400000011626150364341760020024 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapContext Context for this SyncMapInstance */ protected function proxy(): SyncMapContext { if (!$this->context) { $this->context = new SyncMapContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { return $this->proxy()->fetch(); } /** * Access the syncMapItems */ protected function getSyncMapItems(): SyncMapItemList { return $this->proxy()->syncMapItems; } /** * Access the syncMapPermissions */ protected function getSyncMapPermissions(): SyncMapPermissionList { return $this->proxy()->syncMapPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapList.php000064400000013706150364341760017174 0ustar00solution = [ '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'] ); } /** * Reads SyncMapInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncMapInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapPage Page of SyncMapInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapPage Page of SyncMapInstance */ public function getPage(string $targetUrl): SyncMapPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapContext * * @param string $sid */ public function getContext( string $sid ): SyncMapContext { return new SyncMapContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php000064400000003103150364341760017123 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php000064400000003267150364341760023171 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php000064400000010121150364341760023724 0ustar00solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($documentSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the DocumentPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Document. * @param bool $write Boolean flag specifying whether the identity can update the Sync Document. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Document. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php000064400000012272150364341760024055 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'documentSid' => Values::array_get($payload, 'document_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DocumentPermissionContext Context for this DocumentPermissionInstance */ protected function proxy(): DocumentPermissionContext { if (!$this->context) { $this->context = new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { return $this->proxy()->fetch(); } /** * Update the DocumentPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Document. * @param bool $write Boolean flag specifying whether the identity can update the Sync Document. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Document. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php000064400000013537150364341760023231 0ustar00solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($documentSid) .'/Permissions'; } /** * Reads DocumentPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DocumentPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DocumentPermissionPage Page of DocumentPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DocumentPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DocumentPermissionPage Page of DocumentPermissionInstance */ public function getPage(string $targetUrl): DocumentPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Constructs a DocumentPermissionContext * * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function getContext( string $identity ): DocumentPermissionContext { return new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.DocumentPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentList.php000064400000014110150364341760017366 0ustar00solution = [ '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'] ); } /** * Reads DocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DocumentPage Page of DocumentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DocumentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DocumentPage Page of DocumentInstance */ public function getPage(string $targetUrl): DocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPage($this->version, $response, $this->solution); } /** * Constructs a DocumentContext * * @param string $sid */ public function getContext( string $sid ): DocumentContext { return new DocumentContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.DocumentList]'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceOptions.php000064400000014076150364341760016343 0ustar00options['friendlyName'] = $friendlyName; $this->options['webhookUrl'] = $webhookUrl; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $webhookUrl * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * * * @param bool $reachabilityWebhooksEnabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * * * @param bool $aclEnabled * @return $this Fluent Builder */ public function setAclEnabled(bool $aclEnabled): self { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $webhookUrl * @param string $friendlyName * @param bool $reachabilityWebhooksEnabled * @param bool $aclEnabled */ public function __construct( string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE ) { $this->options['webhookUrl'] = $webhookUrl; $this->options['friendlyName'] = $friendlyName; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; } /** * * * @param string $webhookUrl * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param bool $reachabilityWebhooksEnabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * * * @param bool $aclEnabled * @return $this Fluent Builder */ public function setAclEnabled(bool $aclEnabled): self { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceList.php000064400000014001150364341760015607 0ustar00solution = [ ]; $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 ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.ServiceList]'; } } sdk/src/Twilio/Rest/Preview/Sync/ServicePage.php000064400000003024150364341760015553 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceContext.php000064400000013526150364341760016333 0ustar00solution = [ '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([ '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 syncLists */ protected function getSyncLists(): SyncListList { if (!$this->_syncLists) { $this->_syncLists = new SyncListList( $this->version, $this->solution['sid'] ); } return $this->_syncLists; } /** * Access the documents */ protected function getDocuments(): DocumentList { if (!$this->_documents) { $this->_documents = new DocumentList( $this->version, $this->solution['sid'] ); } return $this->_documents; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { if (!$this->_syncMaps) { $this->_syncMaps = new SyncMapList( $this->version, $this->solution['sid'] ); } return $this->_syncMaps; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceInstance.php000064400000012511150364341760016444 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the syncLists */ protected function getSyncLists(): SyncListList { return $this->proxy()->syncLists; } /** * Access the documents */ protected function getDocuments(): DocumentList { return $this->proxy()->documents; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { return $this->proxy()->syncMaps; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers.php000064400000006442150364341760015233 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanOptions.php000064400000017770150364341760017336 0ustar00options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['dataMetering'] = $dataMetering; $this->options['messagingEnabled'] = $messagingEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['commandsEnabled'] = $commandsEnabled; $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; $this->options['internationalRoaming'] = $internationalRoaming; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param bool $dataEnabled * @return $this Fluent Builder */ public function setDataEnabled(bool $dataEnabled): self { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * * * @param int $dataLimit * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * * * @param string $dataMetering * @return $this Fluent Builder */ public function setDataMetering(string $dataMetering): self { $this->options['dataMetering'] = $dataMetering; return $this; } /** * * * @param bool $messagingEnabled * @return $this Fluent Builder */ public function setMessagingEnabled(bool $messagingEnabled): self { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * * * @param bool $voiceEnabled * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * * * @param bool $commandsEnabled * @return $this Fluent Builder */ public function setCommandsEnabled(bool $commandsEnabled): self { $this->options['commandsEnabled'] = $commandsEnabled; return $this; } /** * * * @param bool $nationalRoamingEnabled * @return $this Fluent Builder */ public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self { $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; return $this; } /** * * * @param string[] $internationalRoaming * @return $this Fluent Builder */ public function setInternationalRoaming(array $internationalRoaming): self { $this->options['internationalRoaming'] = $internationalRoaming; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.CreateRatePlanOptions ' . $options . ']'; } } class UpdateRatePlanOptions extends Options { /** * @param string $uniqueName * @param string $friendlyName */ public function __construct( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.UpdateRatePlanOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandContext.php000064400000003634150364341760017171 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimList.php000064400000013023150364341760015623 0ustar00solution = [ ]; $this->uri = '/Sims'; } /** * Reads SimInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SimPage Page of SimInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SimPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'Iccid' => $options['iccid'], 'RatePlan' => $options['ratePlan'], 'EId' => $options['eId'], 'SimRegistrationCode' => $options['simRegistrationCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SimPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SimPage Page of SimInstance */ public function getPage(string $targetUrl): SimPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimPage($this->version, $response, $this->solution); } /** * Constructs a SimContext * * @param string $sid */ public function getContext( string $sid ): SimContext { return new SimContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.SimList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanInstance.php000064400000012244150364341760017436 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dataEnabled' => Values::array_get($payload, 'data_enabled'), 'dataMetering' => Values::array_get($payload, 'data_metering'), 'dataLimit' => Values::array_get($payload, 'data_limit'), 'messagingEnabled' => Values::array_get($payload, 'messaging_enabled'), 'voiceEnabled' => Values::array_get($payload, 'voice_enabled'), 'nationalRoamingEnabled' => Values::array_get($payload, 'national_roaming_enabled'), 'internationalRoaming' => Values::array_get($payload, 'international_roaming'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RatePlanContext Context for this RatePlanInstance */ protected function proxy(): RatePlanContext { if (!$this->context) { $this->context = new RatePlanContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RatePlanInstance { return $this->proxy()->fetch(); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RatePlanInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.RatePlanInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimInstance.php000064400000013560150364341760016462 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimPage.php000064400000003010150364341760015557 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php000064400000005722150364341760017321 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/RatePlans/' . \rawurlencode($sid) .''; } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandList.php000064400000015132150364341760016454 0ustar00solution = [ ]; $this->uri = '/Commands'; } /** * Create the CommandInstance * * @param string $command * @param array|Options $options Optional Arguments * @return CommandInstance Created CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $command, array $options = []): CommandInstance { $options = new Values($options); $data = Values::of([ 'Command' => $command, 'Device' => $options['device'], 'Sim' => $options['sim'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'CommandMode' => $options['commandMode'], 'IncludeSid' => $options['includeSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CommandInstance( $this->version, $payload ); } /** * Reads CommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CommandInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CommandInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CommandPage Page of CommandInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CommandPage { $options = new Values($options); $params = Values::of([ 'Device' => $options['device'], 'Sim' => $options['sim'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CommandPage Page of CommandInstance */ public function getPage(string $targetUrl): CommandPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CommandPage($this->version, $response, $this->solution); } /** * Constructs a CommandContext * * @param string $sid */ public function getContext( string $sid ): CommandContext { return new CommandContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.CommandList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimContext.php000064400000012324150364341760016337 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanList.php000064400000015144150364341760016607 0ustar00solution = [ ]; $this->uri = '/RatePlans'; } /** * Create the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Created RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): RatePlanInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], 'DataEnabled' => Serialize::booleanToString($options['dataEnabled']), 'DataLimit' => $options['dataLimit'], 'DataMetering' => $options['dataMetering'], 'MessagingEnabled' => Serialize::booleanToString($options['messagingEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'CommandsEnabled' => Serialize::booleanToString($options['commandsEnabled']), 'NationalRoamingEnabled' => Serialize::booleanToString($options['nationalRoamingEnabled']), 'InternationalRoaming' => Serialize::map($options['internationalRoaming'], function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RatePlanInstance( $this->version, $payload ); } /** * Reads RatePlanInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RatePlanInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RatePlanInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RatePlanInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RatePlanPage Page of RatePlanInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RatePlanPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RatePlanPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RatePlanInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RatePlanPage Page of RatePlanInstance */ public function getPage(string $targetUrl): RatePlanPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RatePlanPage($this->version, $response, $this->solution); } /** * Constructs a RatePlanContext * * @param string $sid */ public function getContext( string $sid ): RatePlanContext { return new RatePlanContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.RatePlanList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanPage.php000064400000003046150364341760016546 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandOptions.php000064400000014474150364341760017204 0ustar00options['device'] = $device; $this->options['sim'] = $sim; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['commandMode'] = $commandMode; $this->options['includeSid'] = $includeSid; } /** * * * @param string $device * @return $this Fluent Builder */ public function setDevice(string $device): self { $this->options['device'] = $device; return $this; } /** * * * @param string $sim * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * * * @param string $callbackMethod * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * * * @param string $callbackUrl * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * * * @param string $commandMode * @return $this Fluent Builder */ public function setCommandMode(string $commandMode): self { $this->options['commandMode'] = $commandMode; return $this; } /** * * * @param string $includeSid * @return $this Fluent Builder */ public function setIncludeSid(string $includeSid): self { $this->options['includeSid'] = $includeSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.CreateCommandOptions ' . $options . ']'; } } class ReadCommandOptions extends Options { /** * @param string $device * @param string $sim * @param string $status * @param string $direction */ public function __construct( string $device = Values::NONE, string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ) { $this->options['device'] = $device; $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; } /** * * * @param string $device * @return $this Fluent Builder */ public function setDevice(string $device): self { $this->options['device'] = $device; return $this; } /** * * * @param string $sim * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * * * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * * * @param string $direction * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.ReadCommandOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandPage.php000064400000003040150364341760016410 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php000064400000004345150364341760017407 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageList.php000064400000002733150364341760016675 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php000064400000004033150364341760017410 0ustar00options['end'] = $end; $this->options['start'] = $start; } /** * * * @param string $end * @return $this Fluent Builder */ public function setEnd(string $end): self { $this->options['end'] = $end; return $this; } /** * * * @param string $start * @return $this Fluent Builder */ public function setStart(string $start): self { $this->options['start'] = $start; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.FetchUsageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php000064400000007622150364341760017530 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php000064400000003067150364341760016637 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimOptions.php000064400000030055150364341760016347 0ustar00options['status'] = $status; $this->options['iccid'] = $iccid; $this->options['ratePlan'] = $ratePlan; $this->options['eId'] = $eId; $this->options['simRegistrationCode'] = $simRegistrationCode; } /** * * * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * * * @param string $iccid * @return $this Fluent Builder */ public function setIccid(string $iccid): self { $this->options['iccid'] = $iccid; return $this; } /** * * * @param string $ratePlan * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * * * @param string $eId * @return $this Fluent Builder */ public function setEId(string $eId): self { $this->options['eId'] = $eId; return $this; } /** * * * @param string $simRegistrationCode * @return $this Fluent Builder */ public function setSimRegistrationCode(string $simRegistrationCode): self { $this->options['simRegistrationCode'] = $simRegistrationCode; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.ReadSimOptions ' . $options . ']'; } } class UpdateSimOptions extends Options { /** * @param string $uniqueName * @param string $callbackMethod * @param string $callbackUrl * @param string $friendlyName * @param string $ratePlan * @param string $status * @param string $commandsCallbackMethod * @param string $commandsCallbackUrl * @param string $smsFallbackMethod * @param string $smsFallbackUrl * @param string $smsMethod * @param string $smsUrl * @param string $voiceFallbackMethod * @param string $voiceFallbackUrl * @param string $voiceMethod * @param string $voiceUrl */ public function __construct( string $uniqueName = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE, string $ratePlan = Values::NONE, string $status = Values::NONE, string $commandsCallbackMethod = Values::NONE, string $commandsCallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; $this->options['ratePlan'] = $ratePlan; $this->options['status'] = $status; $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $callbackMethod * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * * * @param string $callbackUrl * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $ratePlan * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * * * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * * * @param string $commandsCallbackMethod * @return $this Fluent Builder */ public function setCommandsCallbackMethod(string $commandsCallbackMethod): self { $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; return $this; } /** * * * @param string $commandsCallbackUrl * @return $this Fluent Builder */ public function setCommandsCallbackUrl(string $commandsCallbackUrl): self { $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; return $this; } /** * * * @param string $smsFallbackMethod * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * * * @param string $smsFallbackUrl * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * * * @param string $smsMethod * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * * * @param string $smsUrl * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * * * @param string $voiceFallbackMethod * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * * * @param string $voiceFallbackUrl * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * * * @param string $voiceMethod * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * * * @param string $voiceUrl * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.UpdateSimOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandInstance.php000064400000010110150364341760017274 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace.php000064400000006232150364341760014676 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetPage.php000064400000003051150364341760017346 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php000064400000013031150364341760020235 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'defaultDeploymentSid' => Values::array_get($payload, 'default_deployment_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FleetContext Context for this FleetInstance */ protected function proxy(): FleetContext { if (!$this->context) { $this->context = new FleetContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the FleetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FleetInstance { return $this->proxy()->fetch(); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FleetInstance { return $this->proxy()->update($options); } /** * Access the certificates */ protected function getCertificates(): CertificateList { return $this->proxy()->certificates; } /** * Access the devices */ protected function getDevices(): DeviceList { return $this->proxy()->devices; } /** * Access the keys */ protected function getKeys(): KeyList { return $this->proxy()->keys; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { return $this->proxy()->deployments; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.FleetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php000064400000014405150364341760020123 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($sid) .''; } /** * Delete the FleetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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 certificates */ protected function getCertificates(): CertificateList { if (!$this->_certificates) { $this->_certificates = new CertificateList( $this->version, $this->solution['sid'] ); } return $this->_certificates; } /** * Access the devices */ protected function getDevices(): DeviceList { if (!$this->_devices) { $this->_devices = new DeviceList( $this->version, $this->solution['sid'] ); } return $this->_devices; } /** * Access the keys */ protected function getKeys(): KeyList { if (!$this->_keys) { $this->_keys = new KeyList( $this->version, $this->solution['sid'] ); } return $this->_keys; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { if (!$this->_deployments) { $this->_deployments = new DeploymentList( $this->version, $this->solution['sid'] ); } return $this->_deployments; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.FleetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetList.php000064400000013376150364341760017420 0ustar00solution = [ ]; $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 ); } /** * Reads FleetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FleetInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FleetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FleetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FleetPage Page of FleetInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FleetPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FleetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FleetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FleetPage Page of FleetInstance */ public function getPage(string $targetUrl): FleetPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FleetPage($this->version, $response, $this->solution); } /** * Constructs a FleetContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Fleet resource. */ public function getContext( string $sid ): FleetContext { return new FleetContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.FleetList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php000064400000006665150364341760021333 0ustar00solution = [ 'fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Devices/' . \rawurlencode($sid) .''; } /** * Delete the DeviceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php000064400000025505150364341760021334 0ustar00options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['identity'] = $identity; $this->options['deploymentSid'] = $deploymentSid; $this->options['enabled'] = $enabled; } /** * Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @return $this Fluent Builder */ public function setDeploymentSid(string $deploymentSid): self { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * * * @param bool $enabled * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateDeviceOptions ' . $options . ']'; } } class ReadDeviceOptions extends Options { /** * @param string $deploymentSid Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. */ public function __construct( string $deploymentSid = Values::NONE ) { $this->options['deploymentSid'] = $deploymentSid; } /** * Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. * * @param string $deploymentSid Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. * @return $this Fluent Builder */ public function setDeploymentSid(string $deploymentSid): self { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.ReadDeviceOptions ' . $options . ']'; } } class UpdateDeviceOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @param bool $enabled */ public function __construct( string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['identity'] = $identity; $this->options['deploymentSid'] = $deploymentSid; $this->options['enabled'] = $enabled; } /** * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @return $this Fluent Builder */ public function setDeploymentSid(string $deploymentSid): self { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * * * @param bool $enabled * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateDeviceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php000064400000003106150364341760020077 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php000064400000003130150364341760020543 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php000064400000006330150364341760020651 0ustar00solution = [ 'fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Keys/' . \rawurlencode($sid) .''; } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php000064400000013272150364341760022253 0ustar00options['friendlyName'] = $friendlyName; $this->options['syncServiceSid'] = $syncServiceSid; } /** * Provides a human readable descriptive text for this Deployment, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * @return $this Fluent Builder */ public function setSyncServiceSid(string $syncServiceSid): self { $this->options['syncServiceSid'] = $syncServiceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateDeploymentOptions ' . $options . ']'; } } class UpdateDeploymentOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 64 characters long * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. */ public function __construct( string $friendlyName = Values::NONE, string $syncServiceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['syncServiceSid'] = $syncServiceSid; } /** * Provides a human readable descriptive text for this Deployment, up to 64 characters long * * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 64 characters long * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * @return $this Fluent Builder */ public function setSyncServiceSid(string $syncServiceSid): self { $this->options['syncServiceSid'] = $syncServiceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateDeploymentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php000064400000014303150364341760021527 0ustar00solution = [ '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'] ); } /** * Reads DeploymentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeploymentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeploymentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeploymentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeploymentPage Page of DeploymentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeploymentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeploymentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeploymentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeploymentPage Page of DeploymentInstance */ public function getPage(string $targetUrl): DeploymentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeploymentPage($this->version, $response, $this->solution); } /** * Constructs a DeploymentContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Deployment resource. */ public function getContext( string $sid ): DeploymentContext { return new DeploymentContext( $this->version, $this->solution['fleetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.DeploymentList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php000064400000012123150364341760021435 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'enabled' => Values::array_get($payload, 'enabled'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'identity' => Values::array_get($payload, 'identity'), 'deploymentSid' => Values::array_get($payload, 'deployment_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateAuthenticated' => Deserialize::dateTime(Values::array_get($payload, 'date_authenticated')), ]; $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeviceContext Context for this DeviceInstance */ protected function proxy(): DeviceContext { if (!$this->context) { $this->context = new DeviceContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DeviceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DeviceInstance * * @return DeviceInstance Fetched DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceInstance { return $this->proxy()->fetch(); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DeviceInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeviceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php000064400000011257150364341760020775 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'deviceSid' => Values::array_get($payload, 'device_sid'), 'secret' => Values::array_get($payload, 'secret'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return KeyContext Context for this KeyInstance */ protected function proxy(): KeyContext { if (!$this->context) { $this->context = new KeyContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { return $this->proxy()->fetch(); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): KeyInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.KeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php000064400000015446150364341760020670 0ustar00options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Key credential, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateKeyOptions ' . $options . ']'; } } class ReadKeyOptions extends Options { /** * @param string $deviceSid Filters the resulting list of Keys by a unique string identifier of an authenticated Device. */ public function __construct( string $deviceSid = Values::NONE ) { $this->options['deviceSid'] = $deviceSid; } /** * Filters the resulting list of Keys by a unique string identifier of an authenticated Device. * * @param string $deviceSid Filters the resulting list of Keys by a unique string identifier of an authenticated Device. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.ReadKeyOptions ' . $options . ']'; } } class UpdateKeyOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. */ public function __construct( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Key credential, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php000064400000015213150364341760020607 0ustar00solution = [ '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'] ); } /** * Reads DeviceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeviceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams DeviceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeviceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DevicePage Page of DeviceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DevicePage { $options = new Values($options); $params = Values::of([ 'DeploymentSid' => $options['deploymentSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DevicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeviceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DevicePage Page of DeviceInstance */ public function getPage(string $targetUrl): DevicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DevicePage($this->version, $response, $this->solution); } /** * Constructs a DeviceContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Device resource. */ public function getContext( string $sid ): DeviceContext { return new DeviceContext( $this->version, $this->solution['fleetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.DeviceList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php000064400000003166150364341760021577 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php000064400000014504150364341760020142 0ustar00solution = [ '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'] ); } /** * Reads KeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return KeyInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams KeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of KeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return KeyPage Page of KeyInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): KeyPage { $options = new Values($options); $params = Values::of([ 'DeviceSid' => $options['deviceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new KeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of KeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return KeyPage Page of KeyInstance */ public function getPage(string $targetUrl): KeyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new KeyPage($this->version, $response, $this->solution); } /** * Constructs a KeyContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Key credential resource. */ public function getContext( string $sid ): KeyContext { return new KeyContext( $this->version, $this->solution['fleetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.KeyList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php000064400000011313150364341760022356 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'syncServiceSid' => Values::array_get($payload, 'sync_service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeploymentContext Context for this DeploymentInstance */ protected function proxy(): DeploymentContext { if (!$this->context) { $this->context = new DeploymentContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DeploymentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeploymentInstance { return $this->proxy()->fetch(); } /** * Update the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Updated DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DeploymentInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeploymentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php000064400000003160150364341760021467 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php000064400000015345150364341760021640 0ustar00solution = [ 'fleetSid' => $fleetSid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Certificates'; } /** * Create the CertificateInstance * * @param string $certificateData Provides a URL encoded representation of the public certificate in PEM format. * @param array|Options $options Optional Arguments * @return CertificateInstance Created CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $certificateData, array $options = []): CertificateInstance { $options = new Values($options); $data = Values::of([ 'CertificateData' => $certificateData, 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CertificateInstance( $this->version, $payload, $this->solution['fleetSid'] ); } /** * Reads CertificateInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CertificateInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CertificateInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CertificateInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CertificatePage Page of CertificateInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CertificatePage { $options = new Values($options); $params = Values::of([ 'DeviceSid' => $options['deviceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CertificatePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CertificateInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CertificatePage Page of CertificateInstance */ public function getPage(string $targetUrl): CertificatePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CertificatePage($this->version, $response, $this->solution); } /** * Constructs a CertificateContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Certificate credential resource. */ public function getContext( string $sid ): CertificateContext { return new CertificateContext( $this->version, $this->solution['fleetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.CertificateList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php000064400000011503150364341760022461 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'deviceSid' => Values::array_get($payload, 'device_sid'), 'thumbprint' => Values::array_get($payload, 'thumbprint'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CertificateContext Context for this CertificateInstance */ protected function proxy(): CertificateContext { if (!$this->context) { $this->context = new CertificateContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CertificateInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CertificateInstance * * @return CertificateInstance Fetched CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CertificateInstance { return $this->proxy()->fetch(); } /** * Update the CertificateInstance * * @param array|Options $options Optional Arguments * @return CertificateInstance Updated CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CertificateInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.CertificateInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php000064400000006507150364341760022247 0ustar00solution = [ 'fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Deployments/' . \rawurlencode($sid) .''; } /** * Delete the DeploymentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php000064400000016106150364341760022354 0ustar00options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateCertificateOptions ' . $options . ']'; } } class ReadCertificateOptions extends Options { /** * @param string $deviceSid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. */ public function __construct( string $deviceSid = Values::NONE ) { $this->options['deviceSid'] = $deviceSid; } /** * Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. * * @param string $deviceSid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.ReadCertificateOptions ' . $options . ']'; } } class UpdateCertificateOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. */ public function __construct( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateCertificateOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php000064400000006530150364341760022345 0ustar00solution = [ 'fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Certificates/' . \rawurlencode($sid) .''; } /** * Delete the CertificateInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php000064400000011026150364341760020126 0ustar00options['friendlyName'] = $friendlyName; } /** * Provides a human readable descriptive text for this Fleet, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateFleetOptions ' . $options . ']'; } } class UpdateFleetOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. * @param string $defaultDeploymentSid Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. */ public function __construct( string $friendlyName = Values::NONE, string $defaultDeploymentSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; } /** * Provides a human readable descriptive text for this Fleet, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. * * @param string $defaultDeploymentSid Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. * @return $this Fluent Builder */ public function setDefaultDeploymentSid(string $defaultDeploymentSid): self { $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateFleetOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptPage.php000064400000003064150364341760016644 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return TranscriptInstance \Twilio\Rest\Intelligence\V2\TranscriptInstance */ public function buildInstance(array $payload): TranscriptInstance { return new TranscriptInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.TranscriptPage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServiceOptions.php000064400000041716150364341760016700 0ustar00options['autoTranscribe'] = $autoTranscribe; $this->options['dataLogging'] = $dataLogging; $this->options['friendlyName'] = $friendlyName; $this->options['languageCode'] = $languageCode; $this->options['autoRedaction'] = $autoRedaction; $this->options['mediaRedaction'] = $mediaRedaction; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookHttpMethod'] = $webhookHttpMethod; } /** * Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @return $this Fluent Builder */ public function setAutoTranscribe(bool $autoTranscribe): self { $this->options['autoTranscribe'] = $autoTranscribe; return $this; } /** * Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. * * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. * @return $this Fluent Builder */ public function setDataLogging(bool $dataLogging): self { $this->options['dataLogging'] = $dataLogging; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default language code of the audio. * * @param string $languageCode The default language code of the audio. * @return $this Fluent Builder */ public function setLanguageCode(string $languageCode): self { $this->options['languageCode'] = $languageCode; return $this; } /** * Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @return $this Fluent Builder */ public function setAutoRedaction(bool $autoRedaction): self { $this->options['autoRedaction'] = $autoRedaction; return $this; } /** * Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @return $this Fluent Builder */ public function setMediaRedaction(bool $mediaRedaction): self { $this->options['mediaRedaction'] = $mediaRedaction; return $this; } /** * The URL Twilio will request when executing the Webhook. * * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * @param string $webhookHttpMethod * @return $this Fluent Builder */ public function setWebhookHttpMethod(string $webhookHttpMethod): self { $this->options['webhookHttpMethod'] = $webhookHttpMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $languageCode The default language code of the audio. * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @param string $webhookHttpMethod * @param string $ifMatch The If-Match HTTP request header */ public function __construct( bool $autoTranscribe = Values::BOOL_NONE, bool $dataLogging = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $languageCode = Values::NONE, string $uniqueName = Values::NONE, bool $autoRedaction = Values::BOOL_NONE, bool $mediaRedaction = Values::BOOL_NONE, string $webhookUrl = Values::NONE, string $webhookHttpMethod = Values::NONE, string $ifMatch = Values::NONE ) { $this->options['autoTranscribe'] = $autoTranscribe; $this->options['dataLogging'] = $dataLogging; $this->options['friendlyName'] = $friendlyName; $this->options['languageCode'] = $languageCode; $this->options['uniqueName'] = $uniqueName; $this->options['autoRedaction'] = $autoRedaction; $this->options['mediaRedaction'] = $mediaRedaction; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookHttpMethod'] = $webhookHttpMethod; $this->options['ifMatch'] = $ifMatch; } /** * Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @return $this Fluent Builder */ public function setAutoTranscribe(bool $autoTranscribe): self { $this->options['autoTranscribe'] = $autoTranscribe; return $this; } /** * Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. * * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. * @return $this Fluent Builder */ public function setDataLogging(bool $dataLogging): self { $this->options['dataLogging'] = $dataLogging; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default language code of the audio. * * @param string $languageCode The default language code of the audio. * @return $this Fluent Builder */ public function setLanguageCode(string $languageCode): self { $this->options['languageCode'] = $languageCode; return $this; } /** * Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @return $this Fluent Builder */ public function setAutoRedaction(bool $autoRedaction): self { $this->options['autoRedaction'] = $autoRedaction; return $this; } /** * Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @return $this Fluent Builder */ public function setMediaRedaction(bool $mediaRedaction): self { $this->options['mediaRedaction'] = $mediaRedaction; return $this; } /** * The URL Twilio will request when executing the Webhook. * * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * @param string $webhookHttpMethod * @return $this Fluent Builder */ public function setWebhookHttpMethod(string $webhookHttpMethod): self { $this->options['webhookHttpMethod'] = $webhookHttpMethod; return $this; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptInstance.php000064400000013126150364341760017534 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'status' => Values::array_get($payload, 'status'), 'channel' => Values::array_get($payload, 'channel'), 'dataLogging' => Values::array_get($payload, 'data_logging'), 'languageCode' => Values::array_get($payload, 'language_code'), 'customerKey' => Values::array_get($payload, 'customer_key'), 'mediaStartTime' => Deserialize::dateTime(Values::array_get($payload, 'media_start_time')), 'duration' => Values::array_get($payload, 'duration'), 'url' => Values::array_get($payload, 'url'), 'redaction' => Values::array_get($payload, 'redaction'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TranscriptContext Context for this TranscriptInstance */ protected function proxy(): TranscriptContext { if (!$this->context) { $this->context = new TranscriptContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the TranscriptInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TranscriptInstance * * @return TranscriptInstance Fetched TranscriptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptInstance { return $this->proxy()->fetch(); } /** * Access the operatorResults */ protected function getOperatorResults(): OperatorResultList { return $this->proxy()->operatorResults; } /** * Access the sentences */ protected function getSentences(): SentenceList { return $this->proxy()->sentences; } /** * Access the media */ protected function getMedia(): MediaList { return $this->proxy()->media; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.TranscriptInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServiceList.php000064400000015222150364341760016151 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'AutoTranscribe' => Serialize::booleanToString($options['autoTranscribe']), 'DataLogging' => Serialize::booleanToString($options['dataLogging']), 'FriendlyName' => $options['friendlyName'], 'LanguageCode' => $options['languageCode'], 'AutoRedaction' => Serialize::booleanToString($options['autoRedaction']), 'MediaRedaction' => Serialize::booleanToString($options['mediaRedaction']), 'WebhookUrl' => $options['webhookUrl'], 'WebhookHttpMethod' => $options['webhookHttpMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid A 34 character string that uniquely identifies this Service. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.ServiceList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServicePage.php000064400000003042150364341760016107 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Intelligence\V2\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.ServicePage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptOptions.php000064400000020507150364341760017424 0ustar00options['customerKey'] = $customerKey; $this->options['mediaStartTime'] = $mediaStartTime; } /** * Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. * * @param string $customerKey Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. * @return $this Fluent Builder */ public function setCustomerKey(string $customerKey): self { $this->options['customerKey'] = $customerKey; return $this; } /** * The date that this Transcript's media was started, given in ISO 8601 format. * * @param \DateTime $mediaStartTime The date that this Transcript's media was started, given in ISO 8601 format. * @return $this Fluent Builder */ public function setMediaStartTime(\DateTime $mediaStartTime): self { $this->options['mediaStartTime'] = $mediaStartTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.CreateTranscriptOptions ' . $options . ']'; } } class ReadTranscriptOptions extends Options { /** * @param string $serviceSid The unique SID identifier of the Service. * @param string $beforeStartTime Filter by before StartTime. * @param string $afterStartTime Filter by after StartTime. * @param string $beforeDateCreated Filter by before DateCreated. * @param string $afterDateCreated Filter by after DateCreated. * @param string $status Filter by status. * @param string $languageCode Filter by Language Code. * @param string $sourceSid Filter by SourceSid. */ public function __construct( string $serviceSid = Values::NONE, string $beforeStartTime = Values::NONE, string $afterStartTime = Values::NONE, string $beforeDateCreated = Values::NONE, string $afterDateCreated = Values::NONE, string $status = Values::NONE, string $languageCode = Values::NONE, string $sourceSid = Values::NONE ) { $this->options['serviceSid'] = $serviceSid; $this->options['beforeStartTime'] = $beforeStartTime; $this->options['afterStartTime'] = $afterStartTime; $this->options['beforeDateCreated'] = $beforeDateCreated; $this->options['afterDateCreated'] = $afterDateCreated; $this->options['status'] = $status; $this->options['languageCode'] = $languageCode; $this->options['sourceSid'] = $sourceSid; } /** * The unique SID identifier of the Service. * * @param string $serviceSid The unique SID identifier of the Service. * @return $this Fluent Builder */ public function setServiceSid(string $serviceSid): self { $this->options['serviceSid'] = $serviceSid; return $this; } /** * Filter by before StartTime. * * @param string $beforeStartTime Filter by before StartTime. * @return $this Fluent Builder */ public function setBeforeStartTime(string $beforeStartTime): self { $this->options['beforeStartTime'] = $beforeStartTime; return $this; } /** * Filter by after StartTime. * * @param string $afterStartTime Filter by after StartTime. * @return $this Fluent Builder */ public function setAfterStartTime(string $afterStartTime): self { $this->options['afterStartTime'] = $afterStartTime; return $this; } /** * Filter by before DateCreated. * * @param string $beforeDateCreated Filter by before DateCreated. * @return $this Fluent Builder */ public function setBeforeDateCreated(string $beforeDateCreated): self { $this->options['beforeDateCreated'] = $beforeDateCreated; return $this; } /** * Filter by after DateCreated. * * @param string $afterDateCreated Filter by after DateCreated. * @return $this Fluent Builder */ public function setAfterDateCreated(string $afterDateCreated): self { $this->options['afterDateCreated'] = $afterDateCreated; return $this; } /** * Filter by status. * * @param string $status Filter by status. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Filter by Language Code. * * @param string $languageCode Filter by Language Code. * @return $this Fluent Builder */ public function setLanguageCode(string $languageCode): self { $this->options['languageCode'] = $languageCode; return $this; } /** * Filter by SourceSid. * * @param string $sourceSid Filter by SourceSid. * @return $this Fluent Builder */ public function setSourceSid(string $sourceSid): self { $this->options['sourceSid'] = $sourceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.ReadTranscriptOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php000064400000011661150364341760017416 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Transcripts/' . \rawurlencode($sid) .''; } /** * Delete the TranscriptInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TranscriptInstance * * @return TranscriptInstance Fetched TranscriptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptInstance { $payload = $this->version->fetch('GET', $this->uri); return new TranscriptInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the operatorResults */ protected function getOperatorResults(): OperatorResultList { if (!$this->_operatorResults) { $this->_operatorResults = new OperatorResultList( $this->version, $this->solution['sid'] ); } return $this->_operatorResults; } /** * Access the sentences */ protected function getSentences(): SentenceList { if (!$this->_sentences) { $this->_sentences = new SentenceList( $this->version, $this->solution['sid'] ); } return $this->_sentences; } /** * Access the media */ protected function getMedia(): MediaList { if (!$this->_media) { $this->_media = new MediaList( $this->version, $this->solution['sid'] ); } return $this->_media; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.TranscriptContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptList.php000064400000016146150364341760016710 0ustar00solution = [ ]; $this->uri = '/Transcripts'; } /** * Create the TranscriptInstance * * @param string $serviceSid The unique SID identifier of the Service. * @param array $channel JSON object describing Media Channel including Source and Participants * @param array|Options $options Optional Arguments * @return TranscriptInstance Created TranscriptInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $serviceSid, array $channel, array $options = []): TranscriptInstance { $options = new Values($options); $data = Values::of([ 'ServiceSid' => $serviceSid, 'Channel' => Serialize::jsonObject($channel), 'CustomerKey' => $options['customerKey'], 'MediaStartTime' => Serialize::iso8601DateTime($options['mediaStartTime']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TranscriptInstance( $this->version, $payload ); } /** * Reads TranscriptInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TranscriptInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TranscriptInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TranscriptInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TranscriptPage Page of TranscriptInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TranscriptPage { $options = new Values($options); $params = Values::of([ 'ServiceSid' => $options['serviceSid'], 'BeforeStartTime' => $options['beforeStartTime'], 'AfterStartTime' => $options['afterStartTime'], 'BeforeDateCreated' => $options['beforeDateCreated'], 'AfterDateCreated' => $options['afterDateCreated'], 'Status' => $options['status'], 'LanguageCode' => $options['languageCode'], 'SourceSid' => $options['sourceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TranscriptPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TranscriptInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TranscriptPage Page of TranscriptInstance */ public function getPage(string $targetUrl): TranscriptPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TranscriptPage($this->version, $response, $this->solution); } /** * Constructs a TranscriptContext * * @param string $sid A 34 character string that uniquely identifies this Transcript. */ public function getContext( string $sid ): TranscriptContext { return new TranscriptContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.TranscriptList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServiceContext.php000064400000007335150364341760016670 0ustar00solution = [ '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([ 'AutoTranscribe' => Serialize::booleanToString($options['autoTranscribe']), 'DataLogging' => Serialize::booleanToString($options['dataLogging']), 'FriendlyName' => $options['friendlyName'], 'LanguageCode' => $options['languageCode'], 'UniqueName' => $options['uniqueName'], 'AutoRedaction' => Serialize::booleanToString($options['autoRedaction']), 'MediaRedaction' => Serialize::booleanToString($options['mediaRedaction']), 'WebhookUrl' => $options['webhookUrl'], 'WebhookHttpMethod' => $options['webhookHttpMethod'], ]); $headers = Values::of(['If-Match' => $options['ifMatch']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaInstance.php000064400000006761150364341760020562 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'mediaUrl' => Values::array_get($payload, 'media_url'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MediaContext Context for this MediaInstance */ protected function proxy(): MediaContext { if (!$this->context) { $this->context = new MediaContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the MediaInstance * * @param array|Options $options Optional Arguments * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): MediaInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.MediaInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaPage.php000064400000003104150364341760017656 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return MediaInstance \Twilio\Rest\Intelligence\V2\Transcript\MediaInstance */ public function buildInstance(array $payload): MediaInstance { return new MediaInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.MediaPage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultList.php000064400000013676150364341760021707 0ustar00solution = [ 'transcriptSid' => $transcriptSid, ]; $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) .'/OperatorResults'; } /** * Reads OperatorResultInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return OperatorResultInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams OperatorResultInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of OperatorResultInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return OperatorResultPage Page of OperatorResultInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): OperatorResultPage { $options = new Values($options); $params = Values::of([ 'Redacted' => Serialize::booleanToString($options['redacted']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new OperatorResultPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of OperatorResultInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return OperatorResultPage Page of OperatorResultInstance */ public function getPage(string $targetUrl): OperatorResultPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new OperatorResultPage($this->version, $response, $this->solution); } /** * Constructs a OperatorResultContext * * @param string $operatorSid A 34 character string that identifies this Language Understanding operator sid. */ public function getContext( string $operatorSid ): OperatorResultContext { return new OperatorResultContext( $this->version, $this->solution['transcriptSid'], $operatorSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.OperatorResultList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultInstance.php000064400000012026150364341760022524 0ustar00properties = [ 'operatorType' => Values::array_get($payload, 'operator_type'), 'name' => Values::array_get($payload, 'name'), 'operatorSid' => Values::array_get($payload, 'operator_sid'), 'extractMatch' => Values::array_get($payload, 'extract_match'), 'matchProbability' => Values::array_get($payload, 'match_probability'), 'normalizedResult' => Values::array_get($payload, 'normalized_result'), 'utteranceResults' => Values::array_get($payload, 'utterance_results'), 'utteranceMatch' => Values::array_get($payload, 'utterance_match'), 'predictedLabel' => Values::array_get($payload, 'predicted_label'), 'predictedProbability' => Values::array_get($payload, 'predicted_probability'), 'labelProbabilities' => Values::array_get($payload, 'label_probabilities'), 'extractResults' => Values::array_get($payload, 'extract_results'), 'transcriptSid' => Values::array_get($payload, 'transcript_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['transcriptSid' => $transcriptSid, 'operatorSid' => $operatorSid ?: $this->properties['operatorSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return OperatorResultContext Context for this OperatorResultInstance */ protected function proxy(): OperatorResultContext { if (!$this->context) { $this->context = new OperatorResultContext( $this->version, $this->solution['transcriptSid'], $this->solution['operatorSid'] ); } return $this->context; } /** * Fetch the OperatorResultInstance * * @param array|Options $options Optional Arguments * @return OperatorResultInstance Fetched OperatorResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): OperatorResultInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.OperatorResultInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaOptions.php000064400000004230150364341760020436 0ustar00options['redacted'] = $redacted; } /** * Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. * * @param bool $redacted Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. * @return $this Fluent Builder */ public function setRedacted(bool $redacted): self { $this->options['redacted'] = $redacted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.FetchMediaOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceList.php000064400000012613150364341760020447 0ustar00solution = [ 'transcriptSid' => $transcriptSid, ]; $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) .'/Sentences'; } /** * Reads SentenceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SentenceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SentenceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SentenceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SentencePage Page of SentenceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SentencePage { $options = new Values($options); $params = Values::of([ 'Redacted' => Serialize::booleanToString($options['redacted']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SentencePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SentenceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SentencePage Page of SentenceInstance */ public function getPage(string $targetUrl): SentencePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SentencePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.SentenceList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultPage.php000064400000003204150364341760021632 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return OperatorResultInstance \Twilio\Rest\Intelligence\V2\Transcript\OperatorResultInstance */ public function buildInstance(array $payload): OperatorResultInstance { return new OperatorResultInstance($this->version, $payload, $this->solution['transcriptSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.OperatorResultPage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentencePage.php000064400000003140150364341760020403 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SentenceInstance \Twilio\Rest\Intelligence\V2\Transcript\SentenceInstance */ public function buildInstance(array $payload): SentenceInstance { return new SentenceInstance($this->version, $payload, $this->solution['transcriptSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.SentencePage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php000064400000005305150364341760022406 0ustar00solution = [ 'transcriptSid' => $transcriptSid, 'operatorSid' => $operatorSid, ]; $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) .'/OperatorResults/' . \rawurlencode($operatorSid) .''; } /** * Fetch the OperatorResultInstance * * @param array|Options $options Optional Arguments * @return OperatorResultInstance Fetched OperatorResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): OperatorResultInstance { $options = new Values($options); $params = Values::of([ 'Redacted' => Serialize::booleanToString($options['redacted']), ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new OperatorResultInstance( $this->version, $payload, $this->solution['transcriptSid'], $this->solution['operatorSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.OperatorResultContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaList.php000064400000003002150364341760017712 0ustar00solution = [ 'sid' => $sid, ]; } /** * Constructs a MediaContext */ public function getContext( ): MediaContext { return new MediaContext( $this->version, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.MediaList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceOptions.php000064400000004304150364341760021165 0ustar00options['redacted'] = $redacted; } /** * Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. * * @param bool $redacted Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. * @return $this Fluent Builder */ public function setRedacted(bool $redacted): self { $this->options['redacted'] = $redacted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.ReadSentenceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultOptions.php000064400000007416150364341760022422 0ustar00options['redacted'] = $redacted; } /** * Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * @return $this Fluent Builder */ public function setRedacted(bool $redacted): self { $this->options['redacted'] = $redacted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.FetchOperatorResultOptions ' . $options . ']'; } } class ReadOperatorResultOptions extends Options { /** * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. */ public function __construct( bool $redacted = Values::BOOL_NONE ) { $this->options['redacted'] = $redacted; } /** * Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * @return $this Fluent Builder */ public function setRedacted(bool $redacted): self { $this->options['redacted'] = $redacted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.ReadOperatorResultOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceInstance.php000064400000005413150364341760021300 0ustar00properties = [ 'mediaChannel' => Values::array_get($payload, 'media_channel'), 'sentenceIndex' => Values::array_get($payload, 'sentence_index'), 'startTime' => Values::array_get($payload, 'start_time'), 'endTime' => Values::array_get($payload, 'end_time'), 'transcript' => Values::array_get($payload, 'transcript'), 'sid' => Values::array_get($payload, 'sid'), 'confidence' => Values::array_get($payload, 'confidence'), ]; $this->solution = ['transcriptSid' => $transcriptSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.SentenceInstance]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php000064400000004422150364341760020432 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Transcripts/' . \rawurlencode($sid) .'/Media'; } /** * Fetch the MediaInstance * * @param array|Options $options Optional Arguments * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): MediaInstance { $options = new Values($options); $params = Values::of([ 'Redacted' => Serialize::booleanToString($options['redacted']), ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new MediaInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.MediaContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServiceInstance.php000064400000012416150364341760017004 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'autoRedaction' => Values::array_get($payload, 'auto_redaction'), 'mediaRedaction' => Values::array_get($payload, 'media_redaction'), 'autoTranscribe' => Values::array_get($payload, 'auto_transcribe'), 'dataLogging' => Values::array_get($payload, 'data_logging'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'languageCode' => Values::array_get($payload, 'language_code'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookHttpMethod' => Values::array_get($payload, 'webhook_http_method'), 'version' => Values::array_get($payload, 'version'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2.php000064400000005766150364341760013731 0ustar00version = 'v2'; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } protected function getTranscripts(): TranscriptList { if (!$this->_transcripts) { $this->_transcripts = new TranscriptList($this); } return $this->_transcripts; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2]'; } } sdk/src/Twilio/Rest/Pricing/V1.php000064400000006135150364341760012710 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Pricing/V2/VoiceList.php000064400000006345150364341760014615 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberInstance.php000064400000010346150364341760015625 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/CountryContext.php000064400000004104150364341760015713 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/VoicePage.php000064400000003002150364341760014541 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V2/VoiceInstance.php000064400000003430150364341760015436 0ustar00solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \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]'; } } sdk/src/Twilio/Rest/Pricing/V2/CountryPage.php000064400000003016150364341760015144 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberContext.php000064400000004767150364341760015517 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberList.php000064400000003244150364341760014773 0ustar00solution = [ ]; } /** * Constructs a NumberContext * * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function getContext( string $destinationNumber ): NumberContext { return new NumberContext( $this->version, $destinationNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.NumberList]'; } } sdk/src/Twilio/Rest/Pricing/V2/CountryInstance.php000064400000007361150364341760016043 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberOptions.php000064400000005326150364341760015516 0ustar00options['originationNumber'] = $originationNumber; } /** * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * @return $this Fluent Builder */ public function setOriginationNumber(string $originationNumber): self { $this->options['originationNumber'] = $originationNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Pricing.V2.FetchNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberPage.php000064400000003010150364341760014723 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V2/CountryList.php000064400000012254150364341760015207 0ustar00solution = [ ]; $this->uri = '/Trunking/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php000064400000010321150364341760016663 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php000064400000004107150364341760016763 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryPage.php000064400000003032150364341760016207 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php000064400000004772150364341760016560 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberList.php000064400000003252150364341760016037 0ustar00solution = [ ]; } /** * Constructs a NumberContext * * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function getContext( string $destinationNumber ): NumberContext { return new NumberContext( $this->version, $destinationNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.NumberList]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php000064400000007342150364341760017107 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php000064400000005334150364341760016562 0ustar00options['originationNumber'] = $originationNumber; } /** * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * @return $this Fluent Builder */ public function setOriginationNumber(string $originationNumber): self { $this->options['originationNumber'] = $originationNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Pricing.V2.FetchNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberPage.php000064400000003024150364341760015775 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryList.php000064400000012257150364341760016257 0ustar00solution = [ ]; $this->uri = '/Voice/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V2.php000064400000006307150364341760012712 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberPage.php000064400000003046150364341760015725 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoiceList.php000064400000006332150364341760014610 0ustar00solution = [ ]; } /** * Access the countries */ protected function getCountries(): CountryList { if (!$this->_countries) { $this->_countries = new CountryList( $this->version ); } return $this->_countries; } /** * Access the numbers */ protected function getNumbers(): NumberList { if (!$this->_numbers) { $this->_numbers = new NumberList( $this->version ); } return $this->_numbers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.VoiceList]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoicePage.php000064400000003002150364341760014540 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoiceInstance.php000064400000003430150364341760015435 0ustar00solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \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]'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingPage.php000064400000003032150364341760015413 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php000064400000003452150364341760016616 0ustar00solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \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]'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingInstance.php000064400000003444150364341760016312 0ustar00solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \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]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberList.php000064400000005456150364341760015773 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingList.php000064400000005444150364341760015463 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php000064400000004100150364341760020130 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php000064400000003046150364341760017370 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php000064400000007106150364341760020261 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php000064400000012250150364341760017424 0ustar00solution = [ ]; $this->uri = '/PhoneNumbers/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php000064400000004073150364341760017634 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php000064400000003042150364341760017057 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php000064400000007306150364341760017756 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryList.php000064400000012243150364341760017121 0ustar00solution = [ ]; $this->uri = '/Messaging/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php000064400000007251150364341760016672 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php000064400000004063150364341760016763 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryPage.php000064400000003032150364341760016206 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php000064400000003677150364341760016562 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberList.php000064400000002663150364341760016043 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php000064400000007316150364341760017107 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberPage.php000064400000003024150364341760015774 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryList.php000064400000012233150364341760016250 0ustar00solution = [ ]; $this->uri = '/Voice/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Monitor.php000064400000002362150364341760012454 0ustar00alerts instead. */ protected function getAlerts(): \Twilio\Rest\Monitor\V1\AlertList { echo "alerts is deprecated. Use v1->alerts instead."; return $this->v1->alerts; } /** * @deprecated Use v1->alerts(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextAlerts(string $sid): \Twilio\Rest\Monitor\V1\AlertContext { echo "alerts(\$sid) is deprecated. Use v1->alerts(\$sid) instead."; return $this->v1->alerts($sid); } /** * @deprecated Use v1->events instead. */ protected function getEvents(): \Twilio\Rest\Monitor\V1\EventList { echo "events is deprecated. Use v1->events instead."; return $this->v1->events; } /** * @deprecated Use v1->events(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextEvents(string $sid): \Twilio\Rest\Monitor\V1\EventContext { echo "events(\$sid) is deprecated. Use v1->events(\$sid) instead."; return $this->v1->events($sid); } }sdk/src/Twilio/Rest/FrontlineApiBase.php000064400000004576150364341760014223 0ustar00baseUrl = 'https://frontline-api.twilio.com'; } /** * @return V1 Version v1 of frontline-api */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FrontlineApi]'; } } sdk/src/Twilio/Rest/ConversationsBase.php000064400000004603150364341760014455 0ustar00baseUrl = 'https://conversations.twilio.com'; } /** * @return V1 Version v1 of conversations */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations]'; } } sdk/src/Twilio/Rest/Studio/V1.php000064400000005021150364341760012555 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowContext.php000064400000013476150364341760015047 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .''; } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the FlowInstance * * @param string $status * @param array|Options $options Optional Arguments * @return FlowInstance Updated FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): FlowInstance { $options = new Values($options); $data = Values::of([ 'Status' => $status, 'FriendlyName' => $options['friendlyName'], 'Definition' => Serialize::jsonObject($options['definition']), 'CommitMessage' => $options['commitMessage'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FlowInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the executions */ protected function getExecutions(): ExecutionList { if (!$this->_executions) { $this->_executions = new ExecutionList( $this->version, $this->solution['sid'] ); } return $this->_executions; } /** * Access the revisions */ protected function getRevisions(): FlowRevisionList { if (!$this->_revisions) { $this->_revisions = new FlowRevisionList( $this->version, $this->solution['sid'] ); } return $this->_revisions; } /** * Access the testUsers */ protected function getTestUsers(): FlowTestUserList { if (!$this->_testUsers) { $this->_testUsers = new FlowTestUserList( $this->version, $this->solution['sid'] ); } return $this->_testUsers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.FlowContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/FlowOptions.php000064400000010771150364341760015051 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Studio/V2/FlowList.php000064400000014144150364341760014327 0ustar00solution = [ ]; $this->uri = '/Flows'; } /** * Create the FlowInstance * * @param string $friendlyName The string that you assigned to describe the Flow. * @param string $status * @param array $definition JSON representation of flow definition. * @param array|Options $options Optional Arguments * @return FlowInstance Created FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $status, array $definition, array $options = []): FlowInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Status' => $status, 'Definition' => Serialize::jsonObject($definition), 'CommitMessage' => $options['commitMessage'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FlowInstance( $this->version, $payload ); } /** * Reads FlowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlowInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FlowInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FlowPage Page of FlowInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FlowPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FlowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FlowPage Page of FlowInstance */ public function getPage(string $targetUrl): FlowPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlowPage($this->version, $response, $this->solution); } /** * Constructs a FlowContext * * @param string $sid The SID of the Flow resource to delete. */ public function getContext( string $sid ): FlowContext { return new FlowContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowList]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowInstance.php000064400000013461150364341760015161 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'definition' => Values::array_get($payload, 'definition'), 'status' => Values::array_get($payload, 'status'), 'revision' => Values::array_get($payload, 'revision'), 'commitMessage' => Values::array_get($payload, 'commit_message'), 'valid' => Values::array_get($payload, 'valid'), 'errors' => Values::array_get($payload, 'errors'), 'warnings' => Values::array_get($payload, 'warnings'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FlowContext Context for this FlowInstance */ protected function proxy(): FlowContext { if (!$this->context) { $this->context = new FlowContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { return $this->proxy()->fetch(); } /** * Update the FlowInstance * * @param string $status * @param array|Options $options Optional Arguments * @return FlowInstance Updated FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): FlowInstance { return $this->proxy()->update($status, $options); } /** * Access the executions */ protected function getExecutions(): ExecutionList { return $this->proxy()->executions; } /** * Access the revisions */ protected function getRevisions(): FlowRevisionList { return $this->proxy()->revisions; } /** * Access the testUsers */ protected function getTestUsers(): FlowTestUserList { return $this->proxy()->testUsers; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.FlowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php000064400000012637150364341760017010 0ustar00solution = [ 'flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($sid) .''; } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the ExecutionInstance * * @param string $status * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { $data = Values::of([ 'Status' => $status, ]); $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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionInstance.php000064400000012407150364341760017123 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), 'context' => Values::array_get($payload, 'context'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionContext Context for this ExecutionInstance */ protected function proxy(): ExecutionContext { if (!$this->context) { $this->context = new ExecutionContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { return $this->proxy()->fetch(); } /** * Update the ExecutionInstance * * @param string $status * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { return $this->proxy()->update($status); } /** * Access the steps */ protected function getSteps(): ExecutionStepList { return $this->proxy()->steps; } /** * Access the executionContext */ protected function getExecutionContext(): ExecutionContextList { return $this->proxy()->executionContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionPage.php000064400000003112150364341760016707 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php000064400000005336150364341760017451 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionOptions.php000064400000014576150364341760017023 0ustar00options['parameters'] = $parameters; } /** * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * @return $this Fluent Builder */ public function setParameters(array $parameters): self { $this->options['parameters'] = $parameters; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V2.CreateExecutionOptions ' . $options . ']'; } } class ReadExecutionOptions extends Options { /** * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ public function __construct( \DateTime $dateCreatedFrom = null, \DateTime $dateCreatedTo = null ) { $this->options['dateCreatedFrom'] = $dateCreatedFrom; $this->options['dateCreatedTo'] = $dateCreatedTo; } /** * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return $this Fluent Builder */ public function setDateCreatedFrom(\DateTime $dateCreatedFrom): self { $this->options['dateCreatedFrom'] = $dateCreatedFrom; return $this; } /** * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return $this Fluent Builder */ public function setDateCreatedTo(\DateTime $dateCreatedTo): self { $this->options['dateCreatedTo'] = $dateCreatedTo; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V2.ReadExecutionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionPage.php000064400000003074150364341760016233 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserList.php000064400000003006150364341760016730 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionInstance.php000064400000010711150364341760017602 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserPage.php000064400000003112150364341760016667 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionList.php000064400000012627150364341760016761 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .'/Revisions'; } /** * Reads FlowRevisionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlowRevisionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FlowRevisionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FlowRevisionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FlowRevisionPage Page of FlowRevisionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FlowRevisionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FlowRevisionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlowRevisionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FlowRevisionPage Page of FlowRevisionInstance */ public function getPage(string $targetUrl): FlowRevisionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlowRevisionPage($this->version, $response, $this->solution); } /** * Constructs a FlowRevisionContext * * @param string $revision Specific Revision number or can be `LatestPublished` and `LatestRevision`. */ public function getContext( string $revision ): FlowRevisionContext { return new FlowRevisionContext( $this->version, $this->solution['sid'], $revision ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowRevisionList]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php000064400000004342150364341760017465 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserInstance.php000064400000007202150364341760017563 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextPage.php000064400000003233150364341760021540 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepInstance.php000064400000011664150364341760021726 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php000064400000010475150364341760021605 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepList.php000064400000013300150364341760021062 0ustar00solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Steps'; } /** * Reads ExecutionStepInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionStepInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ExecutionStepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExecutionStepPage Page of ExecutionStepInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExecutionStepPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExecutionStepPage Page of ExecutionStepInstance */ public function getPage(string $targetUrl): ExecutionStepPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionStepContext * * @param string $sid The SID of the ExecutionStep resource to fetch. */ public function getContext( string $sid ): ExecutionStepContext { return new ExecutionStepContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionStepList]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextList.php000064400000003455150364341760021605 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php000064400000004006150364341760025231 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php000064400000010011150364341760026053 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php000064400000003353150364341760025176 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php000064400000005065150364341760025750 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepPage.php000064400000003211150364341760021023 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php000064400000004467150364341760022322 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextInstance.php000064400000007331150364341760022433 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionList.php000064400000015756150364341760016304 0ustar00solution = [ 'flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions'; } /** * Create the ExecutionInstance * * @param string $to The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. * @param array|Options $options Optional Arguments * @return ExecutionInstance Created ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $from, array $options = []): ExecutionInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'] ); } /** * Reads ExecutionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ExecutionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExecutionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExecutionPage Page of ExecutionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExecutionPage { $options = new Values($options); $params = Values::of([ 'DateCreatedFrom' => Serialize::iso8601DateTime($options['dateCreatedFrom']), 'DateCreatedTo' => Serialize::iso8601DateTime($options['dateCreatedTo']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExecutionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExecutionPage Page of ExecutionInstance */ public function getPage(string $targetUrl): ExecutionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionContext * * @param string $sid The SID of the Execution resource to delete. */ public function getContext( string $sid ): ExecutionContext { return new ExecutionContext( $this->version, $this->solution['flowSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionList]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowValidateList.php000064400000004537150364341760016006 0ustar00solution = [ ]; $this->uri = '/Flows/Validate'; } /** * Update the FlowValidateInstance * * @param string $friendlyName The string that you assigned to describe the Flow. * @param string $status * @param array $definition JSON representation of flow definition. * @param array|Options $options Optional Arguments * @return FlowValidateInstance Updated FlowValidateInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName, string $status, array $definition, array $options = []): FlowValidateInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Status' => $status, 'Definition' => Serialize::jsonObject($definition), 'CommitMessage' => $options['commitMessage'], ]); $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]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowValidatePage.php000064400000003050150364341760015734 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowValidateOptions.php000064400000003671150364341760016524 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Studio/V2/FlowValidateInstance.php000064400000003752150364341760016635 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowPage.php000064400000002770150364341760014272 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V2.php000064400000005543150364341760012567 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Studio/V1/FlowContext.php000064400000010551150364341760015035 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .''; } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/FlowList.php000064400000011765150364341760014334 0ustar00solution = [ ]; $this->uri = '/Flows'; } /** * Reads FlowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlowInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FlowInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FlowPage Page of FlowInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FlowPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FlowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FlowPage Page of FlowInstance */ public function getPage(string $targetUrl): FlowPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlowPage($this->version, $response, $this->solution); } /** * Constructs a FlowContext * * @param string $sid The SID of the Flow resource to delete. */ public function getContext( string $sid ): FlowContext { return new FlowContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.FlowList]'; } } sdk/src/Twilio/Rest/Studio/V1/FlowInstance.php000064400000011072150364341760015154 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'version' => Values::array_get($payload, 'version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FlowContext Context for this FlowInstance */ protected function proxy(): FlowContext { if (!$this->context) { $this->context = new FlowContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { return $this->proxy()->fetch(); } /** * Access the engagements */ protected function getEngagements(): EngagementList { return $this->proxy()->engagements; } /** * Access the executions */ protected function getExecutions(): ExecutionList { return $this->proxy()->executions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.FlowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php000064400000012637150364341760017007 0ustar00solution = [ 'flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($sid) .''; } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the ExecutionInstance * * @param string $status * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { $data = Values::of([ 'Status' => $status, ]); $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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php000064400000012041150364341760017223 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'contactSid' => Values::array_get($payload, 'contact_sid'), 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), 'context' => Values::array_get($payload, 'context'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EngagementContext Context for this EngagementInstance */ protected function proxy(): EngagementContext { if (!$this->context) { $this->context = new EngagementContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the EngagementInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EngagementInstance * * @return EngagementInstance Fetched EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EngagementInstance { return $this->proxy()->fetch(); } /** * Access the steps */ protected function getSteps(): StepList { return $this->proxy()->steps; } /** * Access the engagementContext */ protected function getEngagementContext(): EngagementContextList { return $this->proxy()->engagementContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php000064400000003704150364341760021573 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php000064400000003246150364341760021535 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php000064400000004743150364341760022310 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php000064400000007635150364341760022433 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php000064400000003244150364341760021757 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php000064400000007271150364341760022653 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php000064400000003405150364341760022015 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php000064400000010260150364341760020017 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php000064400000003126150364341760017252 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php000064400000013014150364341760017306 0ustar00solution = [ 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements/' . \rawurlencode($engagementSid) .'/Steps'; } /** * Reads StepInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return StepInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams StepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of StepInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return StepPage Page of StepInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): StepPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new StepPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of StepInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return StepPage Page of StepInstance */ public function getPage(string $targetUrl): StepPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new StepPage($this->version, $response, $this->solution); } /** * Constructs a StepContext * * @param string $sid The SID of the Step resource to fetch. */ public function getContext( string $sid ): StepContext { return new StepContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.StepList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php000064400000004423150364341760022527 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php000064400000011457150364341760020150 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php000064400000012564150364341760017126 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'contactSid' => Values::array_get($payload, 'contact_sid'), 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), 'context' => Values::array_get($payload, 'context'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionContext Context for this ExecutionInstance */ protected function proxy(): ExecutionContext { if (!$this->context) { $this->context = new ExecutionContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { return $this->proxy()->fetch(); } /** * Update the ExecutionInstance * * @param string $status * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { return $this->proxy()->update($status); } /** * Access the steps */ protected function getSteps(): ExecutionStepList { return $this->proxy()->steps; } /** * Access the executionContext */ protected function getExecutionContext(): ExecutionContextList { return $this->proxy()->executionContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php000064400000014576150364341760017022 0ustar00options['parameters'] = $parameters; } /** * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * @return $this Fluent Builder */ public function setParameters(array $parameters): self { $this->options['parameters'] = $parameters; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V1.CreateExecutionOptions ' . $options . ']'; } } class ReadExecutionOptions extends Options { /** * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ public function __construct( \DateTime $dateCreatedFrom = null, \DateTime $dateCreatedTo = null ) { $this->options['dateCreatedFrom'] = $dateCreatedFrom; $this->options['dateCreatedTo'] = $dateCreatedTo; } /** * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return $this Fluent Builder */ public function setDateCreatedFrom(\DateTime $dateCreatedFrom): self { $this->options['dateCreatedFrom'] = $dateCreatedFrom; return $this; } /** * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return $this Fluent Builder */ public function setDateCreatedTo(\DateTime $dateCreatedTo): self { $this->options['dateCreatedTo'] = $dateCreatedTo; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V1.ReadExecutionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php000064400000007006150364341760017117 0ustar00options['parameters'] = $parameters; } /** * A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. * * @param array $parameters A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. * @return $this Fluent Builder */ public function setParameters(array $parameters): self { $this->options['parameters'] = $parameters; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V1.CreateEngagementOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php000064400000003074150364341760016232 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementPage.php000064400000003102150364341760016331 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementList.php000064400000015003150364341760016373 0ustar00solution = [ 'flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements'; } /** * Create the EngagementInstance * * @param string $to The Contact phone number to start a Studio Flow Engagement, available as variable `{{contact.channel.address}}`. * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow Engagement. Available as variable `{{flow.channel.address}}` * @param array|Options $options Optional Arguments * @return EngagementInstance Created EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $from, array $options = []): EngagementInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EngagementInstance( $this->version, $payload, $this->solution['flowSid'] ); } /** * Reads EngagementInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EngagementInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EngagementInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EngagementInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EngagementPage Page of EngagementInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EngagementPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EngagementPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EngagementInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EngagementPage Page of EngagementInstance */ public function getPage(string $targetUrl): EngagementPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EngagementPage($this->version, $response, $this->solution); } /** * Constructs a EngagementContext * * @param string $sid The SID of the Engagement resource to delete. */ public function getContext( string $sid ): EngagementContext { return new EngagementContext( $this->version, $this->solution['flowSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.EngagementList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php000064400000011400150364341760017101 0ustar00solution = [ 'flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements/' . \rawurlencode($sid) .''; } /** * Delete the EngagementInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php000064400000003233150364341760021537 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php000064400000011664150364341760021725 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php000064400000010475150364341760021604 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php000064400000013300150364341760021061 0ustar00solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Steps'; } /** * Reads ExecutionStepInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionStepInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ExecutionStepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExecutionStepPage Page of ExecutionStepInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExecutionStepPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExecutionStepPage Page of ExecutionStepInstance */ public function getPage(string $targetUrl): ExecutionStepPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionStepContext * * @param string $sid The SID of the ExecutionStep resource to fetch. */ public function getContext( string $sid ): ExecutionStepContext { return new ExecutionStepContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionStepList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php000064400000003455150364341760021604 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php000064400000004006150364341760025230 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php000064400000010011150364341760026052 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php000064400000003353150364341760025175 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php000064400000005065150364341760025747 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php000064400000003211150364341760021022 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php000064400000004467150364341760022321 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php000064400000007331150364341760022432 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionList.php000064400000015756150364341760016303 0ustar00solution = [ 'flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions'; } /** * Create the ExecutionInstance * * @param string $to The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. * @param array|Options $options Optional Arguments * @return ExecutionInstance Created ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $from, array $options = []): ExecutionInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'] ); } /** * Reads ExecutionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ExecutionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExecutionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExecutionPage Page of ExecutionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExecutionPage { $options = new Values($options); $params = Values::of([ 'DateCreatedFrom' => Serialize::iso8601DateTime($options['dateCreatedFrom']), 'DateCreatedTo' => Serialize::iso8601DateTime($options['dateCreatedTo']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExecutionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExecutionPage Page of ExecutionInstance */ public function getPage(string $targetUrl): ExecutionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionContext * * @param string $sid The SID of the Execution resource to delete. */ public function getContext( string $sid ): ExecutionContext { return new ExecutionContext( $this->version, $this->solution['flowSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionList]'; } } sdk/src/Twilio/Rest/Studio/V1/FlowPage.php000064400000002770150364341760014271 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Content/V1.php000064400000006467150364341760012737 0ustar00version = 'v1'; } protected function getContents(): ContentList { if (!$this->_contents) { $this->_contents = new ContentList($this); } return $this->_contents; } protected function getContentAndApprovals(): ContentAndApprovalsList { if (!$this->_contentAndApprovals) { $this->_contentAndApprovals = new ContentAndApprovalsList($this); } return $this->_contentAndApprovals; } protected function getLegacyContents(): LegacyContentList { if (!$this->_legacyContents) { $this->_legacyContents = new LegacyContentList($this); } return $this->_legacyContents; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1]'; } } sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsList.php000064400000011710150364341760017503 0ustar00solution = [ ]; $this->uri = '/ContentAndApprovals'; } /** * Reads ContentAndApprovalsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ContentAndApprovalsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ContentAndApprovalsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ContentAndApprovalsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ContentAndApprovalsPage Page of ContentAndApprovalsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ContentAndApprovalsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ContentAndApprovalsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ContentAndApprovalsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ContentAndApprovalsPage Page of ContentAndApprovalsInstance */ public function getPage(string $targetUrl): ContentAndApprovalsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ContentAndApprovalsPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentAndApprovalsList]'; } } sdk/src/Twilio/Rest/Content/V1/LegacyContentInstance.php000064400000006154150364341760017154 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php000064400000004105150364341760020437 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php000064400000003132150364341760017666 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php000064400000003141150364341760017725 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php000064400000006642150364341760020567 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Content/V1/LegacyContentPage.php000064400000003062150364341760016257 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Content/V1/LegacyContentList.php000064400000011542150364341760016320 0ustar00solution = [ ]; $this->uri = '/LegacyContent'; } /** * Reads LegacyContentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LegacyContentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams LegacyContentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LegacyContentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LegacyContentPage Page of LegacyContentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LegacyContentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LegacyContentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LegacyContentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LegacyContentPage Page of LegacyContentInstance */ public function getPage(string $targetUrl): LegacyContentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LegacyContentPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.LegacyContentList]'; } } sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsPage.php000064400000003126150364341760017446 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return ContentAndApprovalsInstance \Twilio\Rest\Content\V1\ContentAndApprovalsInstance */ public function buildInstance(array $payload): ContentAndApprovalsInstance { return new ContentAndApprovalsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentAndApprovalsPage]'; } } sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsInstance.php000064400000005662150364341760020345 0ustar00properties = [ 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'language' => Values::array_get($payload, 'language'), 'variables' => Values::array_get($payload, 'variables'), 'types' => Values::array_get($payload, 'types'), 'approvalRequests' => Values::array_get($payload, 'approval_requests'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentAndApprovalsInstance]'; } } sdk/src/Twilio/Rest/Content/V1/ContentInstance.php000064400000011050150364341760016016 0ustar00properties = [ 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'language' => Values::array_get($payload, 'language'), 'variables' => Values::array_get($payload, 'variables'), 'types' => Values::array_get($payload, 'types'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ContentContext Context for this ContentInstance */ protected function proxy(): ContentContext { if (!$this->context) { $this->context = new ContentContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ContentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ContentInstance * * @return ContentInstance Fetched ContentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ContentInstance { return $this->proxy()->fetch(); } /** * Access the 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) . ']'; } } sdk/src/Twilio/Rest/Content/V1/ContentContext.php000064400000007704150364341760015711 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Content/' . \rawurlencode($sid) .''; } /** * Delete the ContentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Content/V1/ContentPage.php000064400000003016150364341760015131 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Content/V1/ContentList.php000064400000012136150364341760015173 0ustar00solution = [ ]; $this->uri = '/Content'; } /** * Reads ContentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ContentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ContentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ContentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ContentPage Page of ContentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ContentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ContentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ContentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ContentPage Page of ContentInstance */ public function getPage(string $targetUrl): ContentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ContentPage($this->version, $response, $this->solution); } /** * Constructs a ContentContext * * @param string $sid The Twilio-provided string that uniquely identifies the Content resource to fetch. */ public function getContext( string $sid ): ContentContext { return new ContentContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentList]'; } } sdk/src/Twilio/Rest/Serverless/V1.php000064400000005115150364341760013447 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php000064400000010277150364341760017460 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Builds/' . \rawurlencode($sid) .''; } /** * Delete the BuildInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetInstance.php000064400000011701150364341760017611 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssetContext Context for this AssetInstance */ protected function proxy(): AssetContext { if (!$this->context) { $this->context = new AssetContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AssetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AssetInstance * * @return AssetInstance Fetched AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssetInstance { return $this->proxy()->fetch(); } /** * Update the AssetInstance * * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. * @return AssetInstance Updated AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): AssetInstance { return $this->proxy()->update($friendlyName); } /** * Access the assetVersions */ protected function getAssetVersions(): AssetVersionList { return $this->proxy()->assetVersions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php000064400000011346150364341760024647 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php000064400000013502150364341760024012 0ustar00solution = [ 'serviceSid' => $serviceSid, 'functionSid' => $functionSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Functions/' . \rawurlencode($functionSid) .'/Versions'; } /** * Reads FunctionVersionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FunctionVersionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FunctionVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FunctionVersionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FunctionVersionPage Page of FunctionVersionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FunctionVersionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FunctionVersionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FunctionVersionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FunctionVersionPage Page of FunctionVersionInstance */ public function getPage(string $targetUrl): FunctionVersionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FunctionVersionPage($this->version, $response, $this->solution); } /** * Constructs a FunctionVersionContext * * @param string $sid The SID of the Function Version resource to fetch. */ public function getContext( string $sid ): FunctionVersionContext { return new FunctionVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['functionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.FunctionVersionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php000064400000003267150364341760023762 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php000064400000011051150364341760024520 0ustar00solution = [ '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) . ']'; } } src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php000064400000004144150364341760030423 0ustar00sdksolution = [ '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]'; } } Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php000064400000010153150364341760031251 0ustar00sdk/srcproperties = [ '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) . ']'; } } Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php000064400000005232150364341760031133 0ustar00sdk/srcsolution = [ '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) . ']'; } } src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php000064400000003431150364341760030362 0ustar00sdksolution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php000064400000012102150364341760020173 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Functions/' . \rawurlencode($sid) .''; } /** * Delete the FunctionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the FunctionInstance * * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. * @return FunctionInstance Updated FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): FunctionInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildInstance.php000064400000011643150364341760017576 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'status' => Values::array_get($payload, 'status'), 'assetVersions' => Values::array_get($payload, 'asset_versions'), 'functionVersions' => Values::array_get($payload, 'function_versions'), 'dependencies' => Values::array_get($payload, 'dependencies'), 'runtime' => Values::array_get($payload, 'runtime'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BuildContext Context for this BuildInstance */ protected function proxy(): BuildContext { if (!$this->context) { $this->context = new BuildContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BuildInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BuildInstance * * @return BuildInstance Fetched BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BuildInstance { return $this->proxy()->fetch(); } /** * Access the buildStatus */ protected function getBuildStatus(): BuildStatusList { return $this->proxy()->buildStatus; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.BuildInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetList.php000064400000014037150364341760016765 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Assets'; } /** * Create the AssetInstance * * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. * @return AssetInstance Created AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): AssetInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AssetInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads AssetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssetInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AssetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssetPage Page of AssetInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssetPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssetPage Page of AssetInstance */ public function getPage(string $targetUrl): AssetPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssetPage($this->version, $response, $this->solution); } /** * Constructs a AssetContext * * @param string $sid The SID that identifies the Asset resource to delete. */ public function getContext( string $sid ): AssetContext { return new AssetContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.AssetList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php000064400000004405150364341760020730 0ustar00options['domainSuffix'] = $domainSuffix; } /** * A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. * * @param string $domainSuffix A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. * @return $this Fluent Builder */ public function setDomainSuffix(string $domainSuffix): self { $this->options['domainSuffix'] = $domainSuffix; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.CreateEnvironmentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildList.php000064400000014515150364341760016746 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Builds'; } /** * Create the BuildInstance * * @param array|Options $options Optional Arguments * @return BuildInstance Created BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): BuildInstance { $options = new Values($options); $data = Values::of([ 'AssetVersions' => Serialize::map($options['assetVersions'], function ($e) { return $e; }), 'FunctionVersions' => Serialize::map($options['functionVersions'], function ($e) { return $e; }), 'Dependencies' => $options['dependencies'], 'Runtime' => $options['runtime'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BuildInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads BuildInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BuildInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BuildInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BuildInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BuildPage Page of BuildInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BuildPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BuildPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BuildInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BuildPage Page of BuildInstance */ public function getPage(string $targetUrl): BuildPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BuildPage($this->version, $response, $this->solution); } /** * Constructs a BuildContext * * @param string $sid The SID of the Build resource to delete. */ public function getContext( string $sid ): BuildContext { return new BuildContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.BuildList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentOptions.php000064400000003611150364341760023046 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php000064400000014751150364341760022335 0ustar00solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Deployments'; } /** * Create the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Created DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): DeploymentInstance { $options = new Values($options); $data = Values::of([ 'BuildSid' => $options['buildSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeploymentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Reads DeploymentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeploymentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeploymentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeploymentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeploymentPage Page of DeploymentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeploymentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeploymentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeploymentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeploymentPage Page of DeploymentInstance */ public function getPage(string $targetUrl): DeploymentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeploymentPage($this->version, $response, $this->solution); } /** * Constructs a DeploymentContext * * @param string $sid The SID that identifies the Deployment resource to fetch. */ public function getContext( string $sid ): DeploymentContext { return new DeploymentContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.DeploymentList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php000064400000011735150364341760022572 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'environmentSid' => Values::array_get($payload, 'environment_sid'), 'key' => Values::array_get($payload, 'key'), 'value' => Values::array_get($payload, 'value'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return VariableContext Context for this VariableInstance */ protected function proxy(): VariableContext { if (!$this->context) { $this->context = new VariableContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the VariableInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the VariableInstance * * @return VariableInstance Fetched VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VariableInstance { return $this->proxy()->fetch(); } /** * Update the VariableInstance * * @param array|Options $options Optional Arguments * @return VariableInstance Updated VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): VariableInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.VariableInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php000064400000011104150364341760021554 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php000064400000015140150364341760021733 0ustar00solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Variables'; } /** * Create the VariableInstance * * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. * @return VariableInstance Created VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, string $value): VariableInstance { $data = Values::of([ 'Key' => $key, 'Value' => $value, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Reads VariableInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return VariableInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams VariableInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of VariableInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return VariablePage Page of VariableInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): VariablePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new VariablePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of VariableInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return VariablePage Page of VariableInstance */ public function getPage(string $targetUrl): VariablePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new VariablePage($this->version, $response, $this->solution); } /** * Constructs a VariableContext * * @param string $sid The SID of the Variable resource to delete. */ public function getContext( string $sid ): VariableContext { return new VariableContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.VariableList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php000064400000003212150364341760021671 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php000064400000005524150364341760022460 0ustar00options['key'] = $key; $this->options['value'] = $value; } /** * A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. * * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. * @return $this Fluent Builder */ public function setKey(string $key): self { $this->options['key'] = $key; return $this; } /** * A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. * * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. * @return $this Fluent Builder */ public function setValue(string $value): self { $this->options['value'] = $value; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.UpdateVariableOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php000064400000010436150364341760023162 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php000064400000007162150364341760022451 0ustar00solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Variables/' . \rawurlencode($sid) .''; } /** * Delete the VariableInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php000064400000003226150364341760022271 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php000064400000005026150364341760023041 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php000064400000003154150364341760020672 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php000064400000014123150364341760020727 0ustar00solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Logs'; } /** * Reads LogInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LogInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams LogInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LogInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LogPage Page of LogInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LogPage { $options = new Values($options); $params = Values::of([ 'FunctionSid' => $options['functionSid'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LogPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LogInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LogPage Page of LogInstance */ public function getPage(string $targetUrl): LogPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LogPage($this->version, $response, $this->solution); } /** * Constructs a LogContext * * @param string $sid The SID of the Log resource to fetch. */ public function getContext( string $sid ): LogContext { return new LogContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.LogList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php000064400000004706150364341760021446 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php000064400000007577150364341760021466 0ustar00options['functionSid'] = $functionSid; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The SID of the function whose invocation produced the Log resources to read. * * @param string $functionSid The SID of the function whose invocation produced the Log resources to read. * @return $this Fluent Builder */ public function setFunctionSid(string $functionSid): self { $this->options['functionSid'] = $functionSid; return $this; } /** * The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. * * @param \DateTime $startDate The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. * * @param \DateTime $endDate The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.ReadLogOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php000064400000014603150364341760020211 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments'; } /** * Create the EnvironmentInstance * * @param string $uniqueName A user-defined string that uniquely identifies the Environment resource. It can be a maximum of 100 characters. * @param array|Options $options Optional Arguments * @return EnvironmentInstance Created EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): EnvironmentInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'DomainSuffix' => $options['domainSuffix'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EnvironmentInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads EnvironmentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EnvironmentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EnvironmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EnvironmentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EnvironmentPage Page of EnvironmentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EnvironmentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EnvironmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EnvironmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EnvironmentPage Page of EnvironmentInstance */ public function getPage(string $targetUrl): EnvironmentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EnvironmentPage($this->version, $response, $this->solution); } /** * Constructs a EnvironmentContext * * @param string $sid The SID of the Environment resource to delete. */ public function getContext( string $sid ): EnvironmentContext { return new EnvironmentContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.EnvironmentList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionPage.php000064400000003117150364341760017431 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php000064400000012600150364341760020715 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($sid) .''; } /** * Delete the EnvironmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the logs */ protected function getLogs(): LogList { if (!$this->_logs) { $this->_logs = new LogList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_logs; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { if (!$this->_deployments) { $this->_deployments = new DeploymentList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_deployments; } /** * Access the variables */ protected function getVariables(): VariableList { if (!$this->_variables) { $this->_variables = new VariableList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_variables; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.EnvironmentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionList.php000064400000014146150364341760017474 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Functions'; } /** * Create the FunctionInstance * * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. * @return FunctionInstance Created FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): FunctionInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FunctionInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads FunctionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FunctionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FunctionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FunctionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FunctionPage Page of FunctionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FunctionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FunctionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FunctionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FunctionPage Page of FunctionInstance */ public function getPage(string $targetUrl): FunctionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FunctionPage($this->version, $response, $this->solution); } /** * Constructs a FunctionContext * * @param string $sid The SID of the Function resource to delete. */ public function getContext( string $sid ): FunctionContext { return new FunctionContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.FunctionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php000064400000012010150364341760020311 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FunctionContext Context for this FunctionInstance */ protected function proxy(): FunctionContext { if (!$this->context) { $this->context = new FunctionContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the FunctionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FunctionInstance * * @return FunctionInstance Fetched FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionInstance { return $this->proxy()->fetch(); } /** * Update the FunctionInstance * * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. * @return FunctionInstance Updated FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): FunctionInstance { return $this->proxy()->update($friendlyName); } /** * Access the functionVersions */ protected function getFunctionVersions(): FunctionVersionList { return $this->proxy()->functionVersions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php000064400000003141150364341760020145 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetPage.php000064400000003075150364341760016726 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusPage.php000064400000003205150364341760021144 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusList.php000064400000003371150364341760021207 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusInstance.php000064400000007162150364341760022042 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php000064400000004361150364341760021720 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildOptions.php000064400000011224150364341760017460 0ustar00options['assetVersions'] = $assetVersions; $this->options['functionVersions'] = $functionVersions; $this->options['dependencies'] = $dependencies; $this->options['runtime'] = $runtime; } /** * The list of Asset Version resource SIDs to include in the Build. * * @param string[] $assetVersions The list of Asset Version resource SIDs to include in the Build. * @return $this Fluent Builder */ public function setAssetVersions(array $assetVersions): self { $this->options['assetVersions'] = $assetVersions; return $this; } /** * The list of the Function Version resource SIDs to include in the Build. * * @param string[] $functionVersions The list of the Function Version resource SIDs to include in the Build. * @return $this Fluent Builder */ public function setFunctionVersions(array $functionVersions): self { $this->options['functionVersions'] = $functionVersions; return $this; } /** * A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. * * @param string $dependencies A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. * @return $this Fluent Builder */ public function setDependencies(string $dependencies): self { $this->options['dependencies'] = $dependencies; return $this; } /** * The Runtime version that will be used to run the Build resource when it is deployed. * * @param string $runtime The Runtime version that will be used to run the Build resource when it is deployed. * @return $this Fluent Builder */ public function setRuntime(string $runtime): self { $this->options['runtime'] = $runtime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.CreateBuildOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildPage.php000064400000003075150364341760016706 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php000064400000011740150364341760017474 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Assets/' . \rawurlencode($sid) .''; } /** * Delete the AssetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the AssetInstance * * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. * @return AssetInstance Updated AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): AssetInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php000064400000012522150364341760021040 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'buildSid' => Values::array_get($payload, 'build_sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'domainSuffix' => Values::array_get($payload, 'domain_suffix'), 'domainName' => Values::array_get($payload, 'domain_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EnvironmentContext Context for this EnvironmentInstance */ protected function proxy(): EnvironmentContext { if (!$this->context) { $this->context = new EnvironmentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the EnvironmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EnvironmentInstance * * @return EnvironmentInstance Fetched EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EnvironmentInstance { return $this->proxy()->fetch(); } /** * Access the logs */ protected function getLogs(): LogList { return $this->proxy()->logs; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { return $this->proxy()->deployments; } /** * Access the variables */ protected function getVariables(): VariableList { return $this->proxy()->variables; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.EnvironmentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php000064400000010357150364341760022244 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php000064400000003220150364341760021343 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php000064400000013350150364341760021407 0ustar00solution = [ 'serviceSid' => $serviceSid, 'assetSid' => $assetSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Assets/' . \rawurlencode($assetSid) .'/Versions'; } /** * Reads AssetVersionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssetVersionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AssetVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssetVersionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssetVersionPage Page of AssetVersionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssetVersionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssetVersionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssetVersionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssetVersionPage Page of AssetVersionInstance */ public function getPage(string $targetUrl): AssetVersionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssetVersionPage($this->version, $response, $this->solution); } /** * Constructs a AssetVersionContext * * @param string $sid The SID of the Asset Version resource to fetch. */ public function getContext( string $sid ): AssetVersionContext { return new AssetVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['assetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.AssetVersionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php000064400000005024150364341760022117 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceOptions.php000064400000014623150364341760016427 0ustar00options['includeCredentials'] = $includeCredentials; $this->options['uiEditable'] = $uiEditable; } /** * Whether to inject Account credentials into a function invocation context. The default value is `true`. * * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. The default value is `true`. * @return $this Fluent Builder */ public function setIncludeCredentials(bool $includeCredentials): self { $this->options['includeCredentials'] = $includeCredentials; return $this; } /** * Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. * * @param bool $uiEditable Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. * @return $this Fluent Builder */ public function setUiEditable(bool $uiEditable): self { $this->options['uiEditable'] = $uiEditable; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. */ public function __construct( bool $includeCredentials = Values::BOOL_NONE, string $friendlyName = Values::NONE, bool $uiEditable = Values::BOOL_NONE ) { $this->options['includeCredentials'] = $includeCredentials; $this->options['friendlyName'] = $friendlyName; $this->options['uiEditable'] = $uiEditable; } /** * Whether to inject Account credentials into a function invocation context. * * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. * @return $this Fluent Builder */ public function setIncludeCredentials(bool $includeCredentials): self { $this->options['includeCredentials'] = $includeCredentials; return $this; } /** * A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. * * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. * @return $this Fluent Builder */ public function setUiEditable(bool $uiEditable): self { $this->options['uiEditable'] = $uiEditable; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceList.php000064400000014735150364341760015713 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $uniqueName A user-defined string that uniquely identifies the Service resource. It can be used as an alternative to the `sid` in the URL path to address the Service resource. This value must be 50 characters or less in length and be unique. * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, string $friendlyName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'FriendlyName' => $friendlyName, 'IncludeCredentials' => Serialize::booleanToString($options['includeCredentials']), 'UiEditable' => Serialize::booleanToString($options['uiEditable']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The `sid` or `unique_name` of the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Serverless/V1/ServicePage.php000064400000003032150364341760015640 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceContext.php000064400000014473150364341760016423 0ustar00solution = [ '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([ '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 functions */ protected function getFunctions(): FunctionList { if (!$this->_functions) { $this->_functions = new FunctionList( $this->version, $this->solution['sid'] ); } return $this->_functions; } /** * Access the builds */ protected function getBuilds(): BuildList { if (!$this->_builds) { $this->_builds = new BuildList( $this->version, $this->solution['sid'] ); } return $this->_builds; } /** * Access the environments */ protected function getEnvironments(): EnvironmentList { if (!$this->_environments) { $this->_environments = new EnvironmentList( $this->version, $this->solution['sid'] ); } return $this->_environments; } /** * Access the assets */ protected function getAssets(): AssetList { if (!$this->_assets) { $this->_assets = new AssetList( $this->version, $this->solution['sid'] ); } return $this->_assets; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceInstance.php000064400000013271150364341760016536 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'includeCredentials' => Values::array_get($payload, 'include_credentials'), 'uiEditable' => Values::array_get($payload, 'ui_editable'), 'domainBase' => Values::array_get($payload, 'domain_base'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the functions */ protected function getFunctions(): FunctionList { return $this->proxy()->functions; } /** * Access the builds */ protected function getBuilds(): BuildList { return $this->proxy()->builds; } /** * Access the environments */ protected function getEnvironments(): EnvironmentList { return $this->proxy()->environments; } /** * Access the assets */ protected function getAssets(): AssetList { return $this->proxy()->assets; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1.php000064400000013224150364341760013132 0ustar00version = 'v1'; } protected function getComplianceInquiries(): ComplianceInquiriesList { if (!$this->_complianceInquiries) { $this->_complianceInquiries = new ComplianceInquiriesList($this); } return $this->_complianceInquiries; } protected function getCustomerProfiles(): CustomerProfilesList { if (!$this->_customerProfiles) { $this->_customerProfiles = new CustomerProfilesList($this); } return $this->_customerProfiles; } protected function getEndUsers(): EndUserList { if (!$this->_endUsers) { $this->_endUsers = new EndUserList($this); } return $this->_endUsers; } protected function getEndUserTypes(): EndUserTypeList { if (!$this->_endUserTypes) { $this->_endUserTypes = new EndUserTypeList($this); } return $this->_endUserTypes; } protected function getPolicies(): PoliciesList { if (!$this->_policies) { $this->_policies = new PoliciesList($this); } return $this->_policies; } protected function getSupportingDocuments(): SupportingDocumentList { if (!$this->_supportingDocuments) { $this->_supportingDocuments = new SupportingDocumentList($this); } return $this->_supportingDocuments; } protected function getSupportingDocumentTypes(): SupportingDocumentTypeList { if (!$this->_supportingDocumentTypes) { $this->_supportingDocumentTypes = new SupportingDocumentTypeList($this); } return $this->_supportingDocumentTypes; } protected function getTrustProducts(): TrustProductsList { if (!$this->_trustProducts) { $this->_trustProducts = new TrustProductsList($this); } return $this->_trustProducts; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php000064400000015407150364341760017351 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($sid) .''; } /** * Delete the TrustProductsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TrustProductsInstance * * @return TrustProductsInstance Fetched TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsInstance { $payload = $this->version->fetch('GET', $this->uri); return new TrustProductsInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the TrustProductsInstance * * @param array|Options $options Optional Arguments * @return TrustProductsInstance Updated TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrustProductsInstance { $options = new Values($options); $data = Values::of([ 'Status' => $options['status'], 'StatusCallback' => $options['statusCallback'], 'FriendlyName' => $options['friendlyName'], 'Email' => $options['email'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TrustProductsInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the trustProductsChannelEndpointAssignment */ protected function getTrustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentList { if (!$this->_trustProductsChannelEndpointAssignment) { $this->_trustProductsChannelEndpointAssignment = new TrustProductsChannelEndpointAssignmentList( $this->version, $this->solution['sid'] ); } return $this->_trustProductsChannelEndpointAssignment; } /** * Access the trustProductsEvaluations */ protected function getTrustProductsEvaluations(): TrustProductsEvaluationsList { if (!$this->_trustProductsEvaluations) { $this->_trustProductsEvaluations = new TrustProductsEvaluationsList( $this->version, $this->solution['sid'] ); } return $this->_trustProductsEvaluations; } /** * Access the trustProductsEntityAssignments */ protected function getTrustProductsEntityAssignments(): TrustProductsEntityAssignmentsList { if (!$this->_trustProductsEntityAssignments) { $this->_trustProductsEntityAssignments = new TrustProductsEntityAssignmentsList( $this->version, $this->solution['sid'] ); } return $this->_trustProductsEntityAssignments; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php000064400000003721150364341760016247 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Policies/' . \rawurlencode($sid) .''; } /** * Fetch the PoliciesInstance * * @return PoliciesInstance Fetched PoliciesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PoliciesInstance { $payload = $this->version->fetch('GET', $this->uri); return new PoliciesInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.PoliciesContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserInstance.php000064400000010726150364341760016170 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EndUserContext Context for this EndUserInstance */ protected function proxy(): EndUserContext { if (!$this->context) { $this->context = new EndUserContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the EndUserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EndUserInstance * * @return EndUserInstance Fetched EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserInstance { return $this->proxy()->fetch(); } /** * Update the EndUserInstance * * @param array|Options $options Optional Arguments * @return EndUserInstance Updated EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): EndUserInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.EndUserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php000064400000003764150364341760016716 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/EndUserTypes/' . \rawurlencode($sid) .''; } /** * Fetch the EndUserTypeInstance * * @return EndUserTypeInstance Fetched EndUserTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserTypeInstance { $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.Trusthub.V1.EndUserTypeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php000064400000004142150364341760021211 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/SupportingDocumentTypes/' . \rawurlencode($sid) .''; } /** * Fetch the SupportingDocumentTypeInstance * * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentTypeInstance { $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.Trusthub.V1.SupportingDocumentTypeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/PoliciesList.php000064400000012131150364341760015531 0ustar00solution = [ ]; $this->uri = '/Policies'; } /** * Reads PoliciesInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PoliciesInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PoliciesInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PoliciesInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PoliciesPage Page of PoliciesInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PoliciesPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PoliciesPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PoliciesInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PoliciesPage Page of PoliciesInstance */ public function getPage(string $targetUrl): PoliciesPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PoliciesPage($this->version, $response, $this->solution); } /** * Constructs a PoliciesContext * * @param string $sid The unique string that identifies the Policy resource. */ public function getContext( string $sid ): PoliciesContext { return new PoliciesContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.PoliciesList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentInstance.php000064400000011523150364341760020470 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'mimeType' => Values::array_get($payload, 'mime_type'), 'status' => Values::array_get($payload, 'status'), 'type' => Values::array_get($payload, 'type'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SupportingDocumentContext Context for this SupportingDocumentInstance */ protected function proxy(): SupportingDocumentContext { if (!$this->context) { $this->context = new SupportingDocumentContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SupportingDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SupportingDocumentInstance * * @return SupportingDocumentInstance Fetched SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentInstance { return $this->proxy()->fetch(); } /** * Update the SupportingDocumentInstance * * @param array|Options $options Optional Arguments * @return SupportingDocumentInstance Updated SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SupportingDocumentInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.SupportingDocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesList.php000064400000005104150364341760017727 0ustar00solution = [ ]; $this->uri = '/ComplianceInquiries/Customers/Initialize'; } /** * Create the ComplianceInquiriesInstance * * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. * @return ComplianceInquiriesInstance Created ComplianceInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $primaryProfileSid): ComplianceInquiriesInstance { $data = Values::of([ 'PrimaryProfileSid' => $primaryProfileSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ComplianceInquiriesInstance( $this->version, $payload ); } /** * Constructs a ComplianceInquiriesContext * * @param string $customerId The unique CustomerId matching the Customer Profile/Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Inquiry creation call. */ public function getContext( string $customerId ): ComplianceInquiriesContext { return new ComplianceInquiriesContext( $this->version, $customerId ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceInquiriesList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserOptions.php000064400000010535150364341760016055 0ustar00options['attributes'] = $attributes; } /** * The set of parameters that are the attributes of the End User resource which are derived End User Types. * * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateEndUserOptions ' . $options . ']'; } } class UpdateEndUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. */ public function __construct( string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The set of parameters that are the attributes of the End User resource which are derived End User Types. * * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateEndUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesPage.php000064400000003110150364341760017225 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return CustomerProfilesInstance \Twilio\Rest\Trusthub\V1\CustomerProfilesInstance */ public function buildInstance(array $payload): CustomerProfilesInstance { return new CustomerProfilesInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php000064400000005415150364341760025625 0ustar00solution = [ 'trustProductSid' => $trustProductSid, 'sid' => $sid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/EntityAssignments/' . \rawurlencode($sid) .''; } /** * Delete the TrustProductsEntityAssignmentsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TrustProductsEntityAssignmentsInstance * * @return TrustProductsEntityAssignmentsInstance Fetched TrustProductsEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsEntityAssignmentsInstance { $payload = $this->version->fetch('GET', $this->uri); return new TrustProductsEntityAssignmentsInstance( $this->version, $payload, $this->solution['trustProductSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsInstance.php000064400000010333150364341760024542 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'policySid' => Values::array_get($payload, 'policy_sid'), 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), 'status' => Values::array_get($payload, 'status'), 'results' => Values::array_get($payload, 'results'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrustProductsEvaluationsContext Context for this TrustProductsEvaluationsInstance */ protected function proxy(): TrustProductsEvaluationsContext { if (!$this->context) { $this->context = new TrustProductsEvaluationsContext( $this->version, $this->solution['trustProductSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the TrustProductsEvaluationsInstance * * @return TrustProductsEvaluationsInstance Fetched TrustProductsEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsEvaluationsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsEvaluationsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentOptions.php000064400000005552150364341760027250 0ustar00options['channelEndpointSid'] = $channelEndpointSid; $this->options['channelEndpointSids'] = $channelEndpointSids; } /** * The SID of an channel endpoint * * @param string $channelEndpointSid The SID of an channel endpoint * @return $this Fluent Builder */ public function setChannelEndpointSid(string $channelEndpointSid): self { $this->options['channelEndpointSid'] = $channelEndpointSid; return $this; } /** * comma separated list of channel endpoint sids * * @param string $channelEndpointSids comma separated list of channel endpoint sids * @return $this Fluent Builder */ public function setChannelEndpointSids(string $channelEndpointSids): self { $this->options['channelEndpointSids'] = $channelEndpointSids; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadTrustProductsChannelEndpointAssignmentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsList.php000064400000015003150364341760023710 0ustar00solution = [ 'trustProductSid' => $trustProductSid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/Evaluations'; } /** * Create the TrustProductsEvaluationsInstance * * @param string $policySid The unique string of a policy that is associated to the customer_profile resource. * @return TrustProductsEvaluationsInstance Created TrustProductsEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $policySid): TrustProductsEvaluationsInstance { $data = Values::of([ 'PolicySid' => $policySid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrustProductsEvaluationsInstance( $this->version, $payload, $this->solution['trustProductSid'] ); } /** * Reads TrustProductsEvaluationsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrustProductsEvaluationsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TrustProductsEvaluationsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrustProductsEvaluationsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrustProductsEvaluationsPage Page of TrustProductsEvaluationsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsEvaluationsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrustProductsEvaluationsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrustProductsEvaluationsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrustProductsEvaluationsPage Page of TrustProductsEvaluationsInstance */ public function getPage(string $targetUrl): TrustProductsEvaluationsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrustProductsEvaluationsPage($this->version, $response, $this->solution); } /** * Constructs a TrustProductsEvaluationsContext * * @param string $sid The unique string that identifies the Evaluation resource. */ public function getContext( string $sid ): TrustProductsEvaluationsContext { return new TrustProductsEvaluationsContext( $this->version, $this->solution['trustProductSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsEvaluationsList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentPage.php000064400000003414150364341760026464 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return TrustProductsChannelEndpointAssignmentInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsChannelEndpointAssignmentInstance */ public function buildInstance(array $payload): TrustProductsChannelEndpointAssignmentInstance { return new TrustProductsChannelEndpointAssignmentInstance($this->version, $payload, $this->solution['trustProductSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php000064400000004630150364341760024425 0ustar00solution = [ 'trustProductSid' => $trustProductSid, 'sid' => $sid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/Evaluations/' . \rawurlencode($sid) .''; } /** * Fetch the TrustProductsEvaluationsInstance * * @return TrustProductsEvaluationsInstance Fetched TrustProductsEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsEvaluationsInstance { $payload = $this->version->fetch('GET', $this->uri); return new TrustProductsEvaluationsInstance( $this->version, $payload, $this->solution['trustProductSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsEvaluationsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsPage.php000064400000003270150364341760023654 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return TrustProductsEvaluationsInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEvaluationsInstance */ public function buildInstance(array $payload): TrustProductsEvaluationsInstance { return new TrustProductsEvaluationsInstance($this->version, $payload, $this->solution['trustProductSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsEvaluationsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsInstance.php000064400000010610150364341760025736 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'objectSid' => Values::array_get($payload, 'object_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrustProductsEntityAssignmentsContext Context for this TrustProductsEntityAssignmentsInstance */ protected function proxy(): TrustProductsEntityAssignmentsContext { if (!$this->context) { $this->context = new TrustProductsEntityAssignmentsContext( $this->version, $this->solution['trustProductSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TrustProductsEntityAssignmentsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TrustProductsEntityAssignmentsInstance * * @return TrustProductsEntityAssignmentsInstance Fetched TrustProductsEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsEntityAssignmentsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentList.php000064400000016710150364341760026526 0ustar00solution = [ 'trustProductSid' => $trustProductSid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/ChannelEndpointAssignments'; } /** * Create the TrustProductsChannelEndpointAssignmentInstance * * @param string $channelEndpointType The type of channel endpoint. eg: phone-number * @param string $channelEndpointSid The SID of an channel endpoint * @return TrustProductsChannelEndpointAssignmentInstance Created TrustProductsChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $channelEndpointType, string $channelEndpointSid): TrustProductsChannelEndpointAssignmentInstance { $data = Values::of([ 'ChannelEndpointType' => $channelEndpointType, 'ChannelEndpointSid' => $channelEndpointSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrustProductsChannelEndpointAssignmentInstance( $this->version, $payload, $this->solution['trustProductSid'] ); } /** * Reads TrustProductsChannelEndpointAssignmentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrustProductsChannelEndpointAssignmentInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TrustProductsChannelEndpointAssignmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrustProductsChannelEndpointAssignmentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrustProductsChannelEndpointAssignmentPage Page of TrustProductsChannelEndpointAssignmentInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsChannelEndpointAssignmentPage { $options = new Values($options); $params = Values::of([ 'ChannelEndpointSid' => $options['channelEndpointSid'], 'ChannelEndpointSids' => $options['channelEndpointSids'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrustProductsChannelEndpointAssignmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrustProductsChannelEndpointAssignmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrustProductsChannelEndpointAssignmentPage Page of TrustProductsChannelEndpointAssignmentInstance */ public function getPage(string $targetUrl): TrustProductsChannelEndpointAssignmentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrustProductsChannelEndpointAssignmentPage($this->version, $response, $this->solution); } /** * Constructs a TrustProductsChannelEndpointAssignmentContext * * @param string $sid The unique string that we created to identify the resource. */ public function getContext( string $sid ): TrustProductsChannelEndpointAssignmentContext { return new TrustProductsChannelEndpointAssignmentContext( $this->version, $this->solution['trustProductSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsPage.php000064400000003334150364341760025053 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return TrustProductsEntityAssignmentsInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEntityAssignmentsInstance */ public function buildInstance(array $payload): TrustProductsEntityAssignmentsInstance { return new TrustProductsEntityAssignmentsInstance($this->version, $payload, $this->solution['trustProductSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentInstance.php000064400000011207150364341760027353 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelEndpointType' => Values::array_get($payload, 'channel_endpoint_type'), 'channelEndpointSid' => Values::array_get($payload, 'channel_endpoint_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrustProductsChannelEndpointAssignmentContext Context for this TrustProductsChannelEndpointAssignmentInstance */ protected function proxy(): TrustProductsChannelEndpointAssignmentContext { if (!$this->context) { $this->context = new TrustProductsChannelEndpointAssignmentContext( $this->version, $this->solution['trustProductSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TrustProductsChannelEndpointAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TrustProductsChannelEndpointAssignmentInstance * * @return TrustProductsChannelEndpointAssignmentInstance Fetched TrustProductsChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsChannelEndpointAssignmentInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php000064400000015227150364341760025116 0ustar00solution = [ 'trustProductSid' => $trustProductSid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/EntityAssignments'; } /** * Create the TrustProductsEntityAssignmentsInstance * * @param string $objectSid The SID of an object bag that holds information of the different items. * @return TrustProductsEntityAssignmentsInstance Created TrustProductsEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $objectSid): TrustProductsEntityAssignmentsInstance { $data = Values::of([ 'ObjectSid' => $objectSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrustProductsEntityAssignmentsInstance( $this->version, $payload, $this->solution['trustProductSid'] ); } /** * Reads TrustProductsEntityAssignmentsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrustProductsEntityAssignmentsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TrustProductsEntityAssignmentsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrustProductsEntityAssignmentsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsEntityAssignmentsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrustProductsEntityAssignmentsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrustProductsEntityAssignmentsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance */ public function getPage(string $targetUrl): TrustProductsEntityAssignmentsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrustProductsEntityAssignmentsPage($this->version, $response, $this->solution); } /** * Constructs a TrustProductsEntityAssignmentsContext * * @param string $sid The unique string that we created to identify the Identity resource. */ public function getContext( string $sid ): TrustProductsEntityAssignmentsContext { return new TrustProductsEntityAssignmentsContext( $this->version, $this->solution['trustProductSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php000064400000005530150364341760027235 0ustar00solution = [ 'trustProductSid' => $trustProductSid, 'sid' => $sid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/ChannelEndpointAssignments/' . \rawurlencode($sid) .''; } /** * Delete the TrustProductsChannelEndpointAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TrustProductsChannelEndpointAssignmentInstance * * @return TrustProductsChannelEndpointAssignmentInstance Fetched TrustProductsChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsChannelEndpointAssignmentInstance { $payload = $this->version->fetch('GET', $this->uri); return new TrustProductsChannelEndpointAssignmentInstance( $this->version, $payload, $this->solution['trustProductSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesInstance.php000064400000014257150364341760020133 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'policySid' => Values::array_get($payload, 'policy_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), 'email' => Values::array_get($payload, 'email'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CustomerProfilesContext Context for this CustomerProfilesInstance */ protected function proxy(): CustomerProfilesContext { if (!$this->context) { $this->context = new CustomerProfilesContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CustomerProfilesInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CustomerProfilesInstance * * @return CustomerProfilesInstance Fetched CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesInstance { return $this->proxy()->fetch(); } /** * Update the CustomerProfilesInstance * * @param array|Options $options Optional Arguments * @return CustomerProfilesInstance Updated CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CustomerProfilesInstance { return $this->proxy()->update($options); } /** * Access the customerProfilesChannelEndpointAssignment */ protected function getCustomerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentList { return $this->proxy()->customerProfilesChannelEndpointAssignment; } /** * Access the customerProfilesEntityAssignments */ protected function getCustomerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsList { return $this->proxy()->customerProfilesEntityAssignments; } /** * Access the customerProfilesEvaluations */ protected function getCustomerProfilesEvaluations(): CustomerProfilesEvaluationsList { return $this->proxy()->customerProfilesEvaluations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeInstance.php000064400000006754150364341760017040 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'machineName' => Values::array_get($payload, 'machine_name'), 'fields' => Values::array_get($payload, 'fields'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EndUserTypeContext Context for this EndUserTypeInstance */ protected function proxy(): EndUserTypeContext { if (!$this->context) { $this->context = new EndUserTypeContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the EndUserTypeInstance * * @return EndUserTypeInstance Fetched EndUserTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserTypeInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.EndUserTypeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php000064400000014100150364341760017456 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'policySid' => Values::array_get($payload, 'policy_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), 'email' => Values::array_get($payload, 'email'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrustProductsContext Context for this TrustProductsInstance */ protected function proxy(): TrustProductsContext { if (!$this->context) { $this->context = new TrustProductsContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the TrustProductsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TrustProductsInstance * * @return TrustProductsInstance Fetched TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsInstance { return $this->proxy()->fetch(); } /** * Update the TrustProductsInstance * * @param array|Options $options Optional Arguments * @return TrustProductsInstance Updated TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrustProductsInstance { return $this->proxy()->update($options); } /** * Access the trustProductsChannelEndpointAssignment */ protected function getTrustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentList { return $this->proxy()->trustProductsChannelEndpointAssignment; } /** * Access the trustProductsEvaluations */ protected function getTrustProductsEvaluations(): TrustProductsEvaluationsList { return $this->proxy()->trustProductsEvaluations; } /** * Access the trustProductsEntityAssignments */ protected function getTrustProductsEntityAssignments(): TrustProductsEntityAssignmentsList { return $this->proxy()->trustProductsEntityAssignments; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserPage.php000064400000003022150364341760015267 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return EndUserInstance \Twilio\Rest\Trusthub\V1\EndUserInstance */ public function buildInstance(array $payload): EndUserInstance { return new EndUserInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.EndUserPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeList.php000064400000012235150364341760016176 0ustar00solution = [ ]; $this->uri = '/EndUserTypes'; } /** * Reads EndUserTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EndUserTypeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EndUserTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EndUserTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EndUserTypePage Page of EndUserTypeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EndUserTypePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EndUserTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EndUserTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EndUserTypePage Page of EndUserTypeInstance */ public function getPage(string $targetUrl): EndUserTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EndUserTypePage($this->version, $response, $this->solution); } /** * Constructs a EndUserTypeContext * * @param string $sid The unique string that identifies the End-User Type resource. */ public function getContext( string $sid ): EndUserTypeContext { return new EndUserTypeContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.EndUserTypeList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesPage.php000064400000003132150364341760017667 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return ComplianceInquiriesInstance \Twilio\Rest\Trusthub\V1\ComplianceInquiriesInstance */ public function buildInstance(array $payload): ComplianceInquiriesInstance { return new ComplianceInquiriesInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceInquiriesPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentOptions.php000064400000011212150364341760020352 0ustar00options['attributes'] = $attributes; } /** * The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. * * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateSupportingDocumentOptions ' . $options . ']'; } } class UpdateSupportingDocumentOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. */ public function __construct( string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. * * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateSupportingDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php000064400000015606150364341760016641 0ustar00solution = [ ]; $this->uri = '/TrustProducts'; } /** * Create the TrustProductsInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. * @param array|Options $options Optional Arguments * @return TrustProductsInstance Created TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $email, string $policySid, array $options = []): TrustProductsInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Email' => $email, 'PolicySid' => $policySid, 'StatusCallback' => $options['statusCallback'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrustProductsInstance( $this->version, $payload ); } /** * Reads TrustProductsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrustProductsInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TrustProductsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrustProductsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrustProductsPage Page of TrustProductsInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'FriendlyName' => $options['friendlyName'], 'PolicySid' => $options['policySid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrustProductsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrustProductsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrustProductsPage Page of TrustProductsInstance */ public function getPage(string $targetUrl): TrustProductsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrustProductsPage($this->version, $response, $this->solution); } /** * Constructs a TrustProductsContext * * @param string $sid The unique string that we created to identify the Customer-Profile resource. */ public function getContext( string $sid ): TrustProductsContext { return new TrustProductsContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php000064400000020154150364341760017353 0ustar00options['statusCallback'] = $statusCallback; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateTrustProductsOptions ' . $options . ']'; } } class ReadTrustProductsOptions extends Options { /** * @param string $status The verification status of the Customer-Profile resource. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. */ public function __construct( string $status = Values::NONE, string $friendlyName = Values::NONE, string $policySid = Values::NONE ) { $this->options['status'] = $status; $this->options['friendlyName'] = $friendlyName; $this->options['policySid'] = $policySid; } /** * The verification status of the Customer-Profile resource. * * @param string $status The verification status of the Customer-Profile resource. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique string of a policy that is associated to the Customer-Profile resource. * * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. * @return $this Fluent Builder */ public function setPolicySid(string $policySid): self { $this->options['policySid'] = $policySid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadTrustProductsOptions ' . $options . ']'; } } class UpdateTrustProductsOptions extends Options { /** * @param string $status * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. */ public function __construct( string $status = Values::NONE, string $statusCallback = Values::NONE, string $friendlyName = Values::NONE, string $email = Values::NONE ) { $this->options['status'] = $status; $this->options['statusCallback'] = $statusCallback; $this->options['friendlyName'] = $friendlyName; $this->options['email'] = $email; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The email address that will receive updates when the Customer-Profile resource changes status. * * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateTrustProductsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php000064400000015673150364341760020016 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($sid) .''; } /** * Delete the CustomerProfilesInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CustomerProfilesInstance * * @return CustomerProfilesInstance Fetched CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesInstance { $payload = $this->version->fetch('GET', $this->uri); return new CustomerProfilesInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the CustomerProfilesInstance * * @param array|Options $options Optional Arguments * @return CustomerProfilesInstance Updated CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CustomerProfilesInstance { $options = new Values($options); $data = Values::of([ 'Status' => $options['status'], 'StatusCallback' => $options['statusCallback'], 'FriendlyName' => $options['friendlyName'], 'Email' => $options['email'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CustomerProfilesInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the customerProfilesChannelEndpointAssignment */ protected function getCustomerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentList { if (!$this->_customerProfilesChannelEndpointAssignment) { $this->_customerProfilesChannelEndpointAssignment = new CustomerProfilesChannelEndpointAssignmentList( $this->version, $this->solution['sid'] ); } return $this->_customerProfilesChannelEndpointAssignment; } /** * Access the customerProfilesEntityAssignments */ protected function getCustomerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsList { if (!$this->_customerProfilesEntityAssignments) { $this->_customerProfilesEntityAssignments = new CustomerProfilesEntityAssignmentsList( $this->version, $this->solution['sid'] ); } return $this->_customerProfilesEntityAssignments; } /** * Access the customerProfilesEvaluations */ protected function getCustomerProfilesEvaluations(): CustomerProfilesEvaluationsList { if (!$this->_customerProfilesEvaluations) { $this->_customerProfilesEvaluations = new CustomerProfilesEvaluationsList( $this->version, $this->solution['sid'] ); } return $this->_customerProfilesEvaluations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsPage.php000064400000003066150364341760016577 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return TrustProductsInstance \Twilio\Rest\Trusthub\V1\TrustProductsInstance */ public function buildInstance(array $payload): TrustProductsInstance { return new TrustProductsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php000064400000006335150364341760020355 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/SupportingDocuments/' . \rawurlencode($sid) .''; } /** * Delete the SupportingDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.SupportingDocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypePage.php000064400000003052150364341760016134 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return EndUserTypeInstance \Twilio\Rest\Trusthub\V1\EndUserTypeInstance */ public function buildInstance(array $payload): EndUserTypeInstance { return new EndUserTypeInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.EndUserTypePage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserList.php000064400000014207150364341760015335 0ustar00solution = [ ]; $this->uri = '/EndUsers'; } /** * Create the EndUserInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $type The type of end user of the Bundle resource - can be `individual` or `business`. * @param array|Options $options Optional Arguments * @return EndUserInstance Created EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $options = []): EndUserInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Attributes' => Serialize::jsonObject($options['attributes']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EndUserInstance( $this->version, $payload ); } /** * Reads EndUserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EndUserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EndUserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EndUserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EndUserPage Page of EndUserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EndUserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EndUserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EndUserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EndUserPage Page of EndUserInstance */ public function getPage(string $targetUrl): EndUserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EndUserPage($this->version, $response, $this->solution); } /** * Constructs a EndUserContext * * @param string $sid The unique string created by Twilio to identify the End User resource. */ public function getContext( string $sid ): EndUserContext { return new EndUserContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.EndUserList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesOptions.php000064400000020234150364341760020012 0ustar00options['statusCallback'] = $statusCallback; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateCustomerProfilesOptions ' . $options . ']'; } } class ReadCustomerProfilesOptions extends Options { /** * @param string $status The verification status of the Customer-Profile resource. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. */ public function __construct( string $status = Values::NONE, string $friendlyName = Values::NONE, string $policySid = Values::NONE ) { $this->options['status'] = $status; $this->options['friendlyName'] = $friendlyName; $this->options['policySid'] = $policySid; } /** * The verification status of the Customer-Profile resource. * * @param string $status The verification status of the Customer-Profile resource. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique string of a policy that is associated to the Customer-Profile resource. * * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. * @return $this Fluent Builder */ public function setPolicySid(string $policySid): self { $this->options['policySid'] = $policySid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadCustomerProfilesOptions ' . $options . ']'; } } class UpdateCustomerProfilesOptions extends Options { /** * @param string $status * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. */ public function __construct( string $status = Values::NONE, string $statusCallback = Values::NONE, string $friendlyName = Values::NONE, string $email = Values::NONE ) { $this->options['status'] = $status; $this->options['statusCallback'] = $statusCallback; $this->options['friendlyName'] = $friendlyName; $this->options['email'] = $email; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The email address that will receive updates when the Customer-Profile resource changes status. * * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateCustomerProfilesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/PoliciesInstance.php000064400000006544150364341760016375 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'requirements' => Values::array_get($payload, 'requirements'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PoliciesContext Context for this PoliciesInstance */ protected function proxy(): PoliciesContext { if (!$this->context) { $this->context = new PoliciesContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the PoliciesInstance * * @return PoliciesInstance Fetched PoliciesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PoliciesInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.PoliciesInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypePage.php000064400000003154150364341760020443 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SupportingDocumentTypeInstance \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeInstance */ public function buildInstance(array $payload): SupportingDocumentTypeInstance { return new SupportingDocumentTypeInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.SupportingDocumentTypePage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/PoliciesPage.php000064400000003030150364341760015470 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return PoliciesInstance \Twilio\Rest\Trusthub\V1\PoliciesInstance */ public function buildInstance(array $payload): PoliciesInstance { return new PoliciesInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.PoliciesPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesContext.php000064400000005150150364341760020441 0ustar00solution = [ 'customerId' => $customerId, ]; $this->uri = '/ComplianceInquiries/Customers/' . \rawurlencode($customerId) .'/Initialize'; } /** * Update the ComplianceInquiriesInstance * * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. * @return ComplianceInquiriesInstance Updated ComplianceInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $primaryProfileSid): ComplianceInquiriesInstance { $data = Values::of([ 'PrimaryProfileSid' => $primaryProfileSid, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ComplianceInquiriesInstance( $this->version, $payload, $this->solution['customerId'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.ComplianceInquiriesContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentPage.php000064400000003124150364341760017576 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SupportingDocumentInstance \Twilio\Rest\Trusthub\V1\SupportingDocumentInstance */ public function buildInstance(array $payload): SupportingDocumentInstance { return new SupportingDocumentInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.SupportingDocumentPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserContext.php000064400000006055150364341760016050 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/EndUsers/' . \rawurlencode($sid) .''; } /** * Delete the EndUserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.EndUserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeInstance.php000064400000007160150364341760021334 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'machineName' => Values::array_get($payload, 'machine_name'), 'fields' => Values::array_get($payload, 'fields'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SupportingDocumentTypeContext Context for this SupportingDocumentTypeInstance */ protected function proxy(): SupportingDocumentTypeContext { if (!$this->context) { $this->context = new SupportingDocumentTypeContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the SupportingDocumentTypeInstance * * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentTypeInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.SupportingDocumentTypeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesInstance.php000064400000007643150364341760020572 0ustar00properties = [ 'inquiryId' => Values::array_get($payload, 'inquiry_id'), 'inquirySessionToken' => Values::array_get($payload, 'inquiry_session_token'), 'customerId' => Values::array_get($payload, 'customer_id'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['customerId' => $customerId ?: $this->properties['customerId'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ComplianceInquiriesContext Context for this ComplianceInquiriesInstance */ protected function proxy(): ComplianceInquiriesContext { if (!$this->context) { $this->context = new ComplianceInquiriesContext( $this->version, $this->solution['customerId'] ); } return $this->context; } /** * Update the ComplianceInquiriesInstance * * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. * @return ComplianceInquiriesInstance Updated ComplianceInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $primaryProfileSid): ComplianceInquiriesInstance { return $this->proxy()->update($primaryProfileSid); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.ComplianceInquiriesInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesList.php000064400000015721150364341760017277 0ustar00solution = [ ]; $this->uri = '/CustomerProfiles'; } /** * Create the CustomerProfilesInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. * @param array|Options $options Optional Arguments * @return CustomerProfilesInstance Created CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $email, string $policySid, array $options = []): CustomerProfilesInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Email' => $email, 'PolicySid' => $policySid, 'StatusCallback' => $options['statusCallback'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CustomerProfilesInstance( $this->version, $payload ); } /** * Reads CustomerProfilesInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CustomerProfilesInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CustomerProfilesInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CustomerProfilesPage Page of CustomerProfilesInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'FriendlyName' => $options['friendlyName'], 'PolicySid' => $options['policySid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CustomerProfilesPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CustomerProfilesInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CustomerProfilesPage Page of CustomerProfilesInstance */ public function getPage(string $targetUrl): CustomerProfilesPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CustomerProfilesPage($this->version, $response, $this->solution); } /** * Constructs a CustomerProfilesContext * * @param string $sid The unique string that we created to identify the Customer-Profile resource. */ public function getContext( string $sid ): CustomerProfilesContext { return new CustomerProfilesContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsList.php000064400000015150150364341760025013 0ustar00solution = [ 'customerProfileSid' => $customerProfileSid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/Evaluations'; } /** * Create the CustomerProfilesEvaluationsInstance * * @param string $policySid The unique string of a policy that is associated to the customer_profile resource. * @return CustomerProfilesEvaluationsInstance Created CustomerProfilesEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $policySid): CustomerProfilesEvaluationsInstance { $data = Values::of([ 'PolicySid' => $policySid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CustomerProfilesEvaluationsInstance( $this->version, $payload, $this->solution['customerProfileSid'] ); } /** * Reads CustomerProfilesEvaluationsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesEvaluationsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CustomerProfilesEvaluationsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CustomerProfilesEvaluationsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CustomerProfilesEvaluationsPage Page of CustomerProfilesEvaluationsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesEvaluationsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CustomerProfilesEvaluationsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CustomerProfilesEvaluationsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CustomerProfilesEvaluationsPage Page of CustomerProfilesEvaluationsInstance */ public function getPage(string $targetUrl): CustomerProfilesEvaluationsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CustomerProfilesEvaluationsPage($this->version, $response, $this->solution); } /** * Constructs a CustomerProfilesEvaluationsContext * * @param string $sid The unique string that identifies the Evaluation resource. */ public function getContext( string $sid ): CustomerProfilesEvaluationsContext { return new CustomerProfilesEvaluationsContext( $this->version, $this->solution['customerProfileSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentList.php000064400000017053150364341760027627 0ustar00solution = [ 'customerProfileSid' => $customerProfileSid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/ChannelEndpointAssignments'; } /** * Create the CustomerProfilesChannelEndpointAssignmentInstance * * @param string $channelEndpointType The type of channel endpoint. eg: phone-number * @param string $channelEndpointSid The SID of an channel endpoint * @return CustomerProfilesChannelEndpointAssignmentInstance Created CustomerProfilesChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $channelEndpointType, string $channelEndpointSid): CustomerProfilesChannelEndpointAssignmentInstance { $data = Values::of([ 'ChannelEndpointType' => $channelEndpointType, 'ChannelEndpointSid' => $channelEndpointSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CustomerProfilesChannelEndpointAssignmentInstance( $this->version, $payload, $this->solution['customerProfileSid'] ); } /** * Reads CustomerProfilesChannelEndpointAssignmentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesChannelEndpointAssignmentInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CustomerProfilesChannelEndpointAssignmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CustomerProfilesChannelEndpointAssignmentPage Page of CustomerProfilesChannelEndpointAssignmentInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesChannelEndpointAssignmentPage { $options = new Values($options); $params = Values::of([ 'ChannelEndpointSid' => $options['channelEndpointSid'], 'ChannelEndpointSids' => $options['channelEndpointSids'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CustomerProfilesChannelEndpointAssignmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CustomerProfilesChannelEndpointAssignmentPage Page of CustomerProfilesChannelEndpointAssignmentInstance */ public function getPage(string $targetUrl): CustomerProfilesChannelEndpointAssignmentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CustomerProfilesChannelEndpointAssignmentPage($this->version, $response, $this->solution); } /** * Constructs a CustomerProfilesChannelEndpointAssignmentContext * * @param string $sid The unique string that we created to identify the resource. */ public function getContext( string $sid ): CustomerProfilesChannelEndpointAssignmentContext { return new CustomerProfilesChannelEndpointAssignmentContext( $this->version, $this->solution['customerProfileSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentPage.php000064400000003447150364341760027572 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return CustomerProfilesChannelEndpointAssignmentInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesChannelEndpointAssignmentInstance */ public function buildInstance(array $payload): CustomerProfilesChannelEndpointAssignmentInstance { return new CustomerProfilesChannelEndpointAssignmentInstance($this->version, $payload, $this->solution['customerProfileSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php000064400000004712150364341760025526 0ustar00solution = [ 'customerProfileSid' => $customerProfileSid, 'sid' => $sid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/Evaluations/' . \rawurlencode($sid) .''; } /** * Fetch the CustomerProfilesEvaluationsInstance * * @return CustomerProfilesEvaluationsInstance Fetched CustomerProfilesEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesEvaluationsInstance { $payload = $this->version->fetch('GET', $this->uri); return new CustomerProfilesEvaluationsInstance( $this->version, $payload, $this->solution['customerProfileSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php000064400000015375150364341760026222 0ustar00solution = [ 'customerProfileSid' => $customerProfileSid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/EntityAssignments'; } /** * Create the CustomerProfilesEntityAssignmentsInstance * * @param string $objectSid The SID of an object bag that holds information of the different items. * @return CustomerProfilesEntityAssignmentsInstance Created CustomerProfilesEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $objectSid): CustomerProfilesEntityAssignmentsInstance { $data = Values::of([ 'ObjectSid' => $objectSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CustomerProfilesEntityAssignmentsInstance( $this->version, $payload, $this->solution['customerProfileSid'] ); } /** * Reads CustomerProfilesEntityAssignmentsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesEntityAssignmentsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CustomerProfilesEntityAssignmentsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CustomerProfilesEntityAssignmentsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesEntityAssignmentsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CustomerProfilesEntityAssignmentsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CustomerProfilesEntityAssignmentsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance */ public function getPage(string $targetUrl): CustomerProfilesEntityAssignmentsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CustomerProfilesEntityAssignmentsPage($this->version, $response, $this->solution); } /** * Constructs a CustomerProfilesEntityAssignmentsContext * * @param string $sid The unique string that we created to identify the Identity resource. */ public function getContext( string $sid ): CustomerProfilesEntityAssignmentsContext { return new CustomerProfilesEntityAssignmentsContext( $this->version, $this->solution['customerProfileSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsPage.php000064400000003367150364341760026161 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return CustomerProfilesEntityAssignmentsInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEntityAssignmentsInstance */ public function buildInstance(array $payload): CustomerProfilesEntityAssignmentsInstance { return new CustomerProfilesEntityAssignmentsInstance($this->version, $payload, $this->solution['customerProfileSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsInstance.php000064400000010712150364341760027041 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'objectSid' => Values::array_get($payload, 'object_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CustomerProfilesEntityAssignmentsContext Context for this CustomerProfilesEntityAssignmentsInstance */ protected function proxy(): CustomerProfilesEntityAssignmentsContext { if (!$this->context) { $this->context = new CustomerProfilesEntityAssignmentsContext( $this->version, $this->solution['customerProfileSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CustomerProfilesEntityAssignmentsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CustomerProfilesEntityAssignmentsInstance * * @return CustomerProfilesEntityAssignmentsInstance Fetched CustomerProfilesEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesEntityAssignmentsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsPage.php000064400000003323150364341760024753 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return CustomerProfilesEvaluationsInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEvaluationsInstance */ public function buildInstance(array $payload): CustomerProfilesEvaluationsInstance { return new CustomerProfilesEvaluationsInstance($this->version, $payload, $this->solution['customerProfileSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsInstance.php000064400000010431150364341760025641 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'policySid' => Values::array_get($payload, 'policy_sid'), 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), 'status' => Values::array_get($payload, 'status'), 'results' => Values::array_get($payload, 'results'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CustomerProfilesEvaluationsContext Context for this CustomerProfilesEvaluationsInstance */ protected function proxy(): CustomerProfilesEvaluationsContext { if (!$this->context) { $this->context = new CustomerProfilesEvaluationsContext( $this->version, $this->solution['customerProfileSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the CustomerProfilesEvaluationsInstance * * @return CustomerProfilesEvaluationsInstance Fetched CustomerProfilesEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesEvaluationsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsInstance ' . \implode(' ', $context) . ']'; } } src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php000064400000005613150364341760030260 0ustar00sdksolution = [ 'customerProfileSid' => $customerProfileSid, 'sid' => $sid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/ChannelEndpointAssignments/' . \rawurlencode($sid) .''; } /** * Delete the CustomerProfilesChannelEndpointAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CustomerProfilesChannelEndpointAssignmentInstance * * @return CustomerProfilesChannelEndpointAssignmentInstance Fetched CustomerProfilesChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance { $payload = $this->version->fetch('GET', $this->uri); return new CustomerProfilesChannelEndpointAssignmentInstance( $this->version, $payload, $this->solution['customerProfileSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentContext ' . \implode(' ', $context) . ']'; } } src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentOptions.php000064400000005577150364341760030300 0ustar00sdkoptions['channelEndpointSid'] = $channelEndpointSid; $this->options['channelEndpointSids'] = $channelEndpointSids; } /** * The SID of an channel endpoint * * @param string $channelEndpointSid The SID of an channel endpoint * @return $this Fluent Builder */ public function setChannelEndpointSid(string $channelEndpointSid): self { $this->options['channelEndpointSid'] = $channelEndpointSid; return $this; } /** * comma separated list of channel endpoint sids * * @param string $channelEndpointSids comma separated list of channel endpoint sids * @return $this Fluent Builder */ public function setChannelEndpointSids(string $channelEndpointSids): self { $this->options['channelEndpointSids'] = $channelEndpointSids; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadCustomerProfilesChannelEndpointAssignmentOptions ' . $options . ']'; } } src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentInstance.php000064400000011306150364341760030374 0ustar00sdkproperties = [ 'sid' => Values::array_get($payload, 'sid'), 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelEndpointType' => Values::array_get($payload, 'channel_endpoint_type'), 'channelEndpointSid' => Values::array_get($payload, 'channel_endpoint_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CustomerProfilesChannelEndpointAssignmentContext Context for this CustomerProfilesChannelEndpointAssignmentInstance */ protected function proxy(): CustomerProfilesChannelEndpointAssignmentContext { if (!$this->context) { $this->context = new CustomerProfilesChannelEndpointAssignmentContext( $this->version, $this->solution['customerProfileSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CustomerProfilesChannelEndpointAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CustomerProfilesChannelEndpointAssignmentInstance * * @return CustomerProfilesChannelEndpointAssignmentInstance Fetched CustomerProfilesChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php000064400000005503150364341760026723 0ustar00solution = [ 'customerProfileSid' => $customerProfileSid, 'sid' => $sid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/EntityAssignments/' . \rawurlencode($sid) .''; } /** * Delete the CustomerProfilesEntityAssignmentsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CustomerProfilesEntityAssignmentsInstance * * @return CustomerProfilesEntityAssignmentsInstance Fetched CustomerProfilesEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesEntityAssignmentsInstance { $payload = $this->version->fetch('GET', $this->uri); return new CustomerProfilesEntityAssignmentsInstance( $this->version, $payload, $this->solution['customerProfileSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentList.php000064400000014571150364341760017645 0ustar00solution = [ ]; $this->uri = '/SupportingDocuments'; } /** * Create the SupportingDocumentInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $type The type of the Supporting Document. * @param array|Options $options Optional Arguments * @return SupportingDocumentInstance Created SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $options = []): SupportingDocumentInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Attributes' => Serialize::jsonObject($options['attributes']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SupportingDocumentInstance( $this->version, $payload ); } /** * Reads SupportingDocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SupportingDocumentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SupportingDocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SupportingDocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SupportingDocumentPage Page of SupportingDocumentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SupportingDocumentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SupportingDocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SupportingDocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SupportingDocumentPage Page of SupportingDocumentInstance */ public function getPage(string $targetUrl): SupportingDocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SupportingDocumentPage($this->version, $response, $this->solution); } /** * Constructs a SupportingDocumentContext * * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. */ public function getContext( string $sid ): SupportingDocumentContext { return new SupportingDocumentContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.SupportingDocumentList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeList.php000064400000012604150364341760020502 0ustar00solution = [ ]; $this->uri = '/SupportingDocumentTypes'; } /** * Reads SupportingDocumentTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SupportingDocumentTypeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SupportingDocumentTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SupportingDocumentTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SupportingDocumentTypePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SupportingDocumentTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SupportingDocumentTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance */ public function getPage(string $targetUrl): SupportingDocumentTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SupportingDocumentTypePage($this->version, $response, $this->solution); } /** * Constructs a SupportingDocumentTypeContext * * @param string $sid The unique string that identifies the Supporting Document Type resource. */ public function getContext( string $sid ): SupportingDocumentTypeContext { return new SupportingDocumentTypeContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.SupportingDocumentTypeList]'; } } sdk/src/Twilio/Rest/Voice.php000064400000007403150364341760012073 0ustar00archivedCalls instead. */ protected function getArchivedCalls(): \Twilio\Rest\Voice\V1\ArchivedCallList { echo "archivedCalls is deprecated. Use v1->archivedCalls instead."; return $this->v1->archivedCalls; } /** * @deprecated Use v1->archivedCalls(\$date, \$sid) instead. * @param \DateTime $date The date of the Call in UTC. * @param string $sid The unique string that identifies this resource */ protected function contextArchivedCalls(\DateTime $date, string $sid): \Twilio\Rest\Voice\V1\ArchivedCallContext { echo "archivedCalls(\$date, \$sid) is deprecated. Use v1->archivedCalls(\$date, \$sid) instead."; return $this->v1->archivedCalls($date, $sid); } /** * @deprecated Use v1->byocTrunks instead. */ protected function getByocTrunks(): \Twilio\Rest\Voice\V1\ByocTrunkList { echo "byocTrunks is deprecated. Use v1->byocTrunks instead."; return $this->v1->byocTrunks; } /** * @deprecated Use v1->byocTrunks(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextByocTrunks(string $sid): \Twilio\Rest\Voice\V1\ByocTrunkContext { echo "byocTrunks(\$sid) is deprecated. Use v1->byocTrunks(\$sid) instead."; return $this->v1->byocTrunks($sid); } /** * @deprecated Use v1->connectionPolicies instead. */ protected function getConnectionPolicies(): \Twilio\Rest\Voice\V1\ConnectionPolicyList { echo "connectionPolicies is deprecated. Use v1->connectionPolicies instead."; return $this->v1->connectionPolicies; } /** * @deprecated Use v1->connectionPolicies(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextConnectionPolicies(string $sid): \Twilio\Rest\Voice\V1\ConnectionPolicyContext { echo "connectionPolicies(\$sid) is deprecated. Use v1->connectionPolicies(\$sid) instead."; return $this->v1->connectionPolicies($sid); } /** * @deprecated Use v1->dialingPermissions instead. */ protected function getDialingPermissions(): \Twilio\Rest\Voice\V1\DialingPermissionsList { echo "dialingPermissions is deprecated. Use v1->dialingPermissions instead."; return $this->v1->dialingPermissions; } /** * @deprecated Use v1->ipRecords instead. */ protected function getIpRecords(): \Twilio\Rest\Voice\V1\IpRecordList { echo "ipRecords is deprecated. Use v1->ipRecords instead."; return $this->v1->ipRecords; } /** * @deprecated Use v1->ipRecords(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextIpRecords(string $sid): \Twilio\Rest\Voice\V1\IpRecordContext { echo "ipRecords(\$sid) is deprecated. Use v1->ipRecords(\$sid) instead."; return $this->v1->ipRecords($sid); } /** * @deprecated Use v1->sourceIpMappings instead. */ protected function getSourceIpMappings(): \Twilio\Rest\Voice\V1\SourceIpMappingList { echo "sourceIpMappings is deprecated. Use v1->sourceIpMappings instead."; return $this->v1->sourceIpMappings; } /** * @deprecated Use v1->sourceIpMappings(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextSourceIpMappings(string $sid): \Twilio\Rest\Voice\V1\SourceIpMappingContext { echo "sourceIpMappings(\$sid) is deprecated. Use v1->sourceIpMappings(\$sid) instead."; return $this->v1->sourceIpMappings($sid); } }sdk/src/Twilio/Rest/SyncBase.php000064400000004504150364341760012534 0ustar00baseUrl = 'https://sync.twilio.com'; } /** * @return V1 Version v1 of sync */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync]'; } } sdk/src/Twilio/Rest/NumbersBase.php000064400000005176150364341760013241 0ustar00baseUrl = 'https://numbers.twilio.com'; } /** * @return V1 Version v1 of numbers */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of numbers */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers]'; } } sdk/src/Twilio/Rest/FrontlineApi.php000064400000001257150364341760013421 0ustar00users instead. */ protected function getUsers(): \Twilio\Rest\FrontlineApi\V1\UserList { echo "users is deprecated. Use v1->users instead."; return $this->v1->users; } /** * @deprecated Use v1->users(\$sid) instead. * @param string $sid The SID of the User resource to fetch */ protected function contextUsers(string $sid): \Twilio\Rest\FrontlineApi\V1\UserContext { echo "users(\$sid) is deprecated. Use v1->users(\$sid) instead."; return $this->v1->users($sid); } }sdk/src/Twilio/Rest/AccountsBase.php000064400000004540150364341760013377 0ustar00baseUrl = 'https://accounts.twilio.com'; } /** * @return V1 Version v1 of accounts */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts]'; } } sdk/src/Twilio/Rest/Sync/V1.php000064400000005051150364341760012225 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php000064400000014743150364341760016563 0ustar00options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncMapOptions ' . $options . ']'; } } class UpdateSyncMapOptions extends Options { /** * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. */ public function __construct( int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncMapOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListOptions.php000064400000015466150364341760016764 0ustar00options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Alias for collection_ttl. If both are provided, this value is ignored. * * @param int $ttl Alias for collection_ttl. If both are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncListOptions ' . $options . ']'; } } class UpdateSyncListOptions extends Options { /** * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. */ public function __construct( int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `collection_ttl`. If both are provided, this value is ignored. * * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncListOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentPage.php000064400000003067150364341760016205 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php000064400000012554150364341760021063 0ustar00properties = [ 'key' => Values::array_get($payload, 'key'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key ?: $this->properties['key'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapItemContext Context for this SyncMapItemInstance */ protected function proxy(): SyncMapItemContext { if (!$this->context) { $this->context = new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } return $this->context; } /** * Delete the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncMapItemInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php000064400000003230150364341760021414 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php000064400000040662150364341760020753 0ustar00options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setItemTtl(int $itemTtl): self { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncMapItemOptions ' . $options . ']'; } } class DeleteSyncMapItemOptions extends Options { /** * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.DeleteSyncMapItemOptions ' . $options . ']'; } } class ReadSyncMapItemOptions extends Options { /** * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. */ public function __construct( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. * * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * The `key` of the first Sync Map Item resource to read. See also `bounds`. * * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. * * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. * @return $this Fluent Builder */ public function setBounds(string $bounds): self { $this->options['bounds'] = $bounds; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.ReadSyncMapItemOptions ' . $options . ']'; } } class UpdateSyncMapItemOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE, string $ifMatch = Values::NONE ) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; $this->options['ifMatch'] = $ifMatch; } /** * A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setItemTtl(int $itemTtl): self { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncMapItemOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php000064400000012607150364341760022314 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapPermissionContext Context for this SyncMapPermissionInstance */ protected function proxy(): SyncMapPermissionContext { if (!$this->context) { $this->context = new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapPermissionInstance * * @param bool $read Whether the identity can read the Sync Map and its Items. Default value is `false`. * @param bool $write Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync Map. Default value is `false`. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php000064400000016707150364341760020236 0ustar00solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Items'; } /** * Create the SyncMapItemInstance * * @param string $key The unique, user-defined key for the Map Item. Can be up to 320 characters long. * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Created SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, array $data, array $options = []): SyncMapItemInstance { $options = new Values($options); $data = Values::of([ 'Key' => $key, 'Data' => Serialize::jsonObject($data), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Reads SyncMapItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapItemInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SyncMapItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapItemPage Page of SyncMapItemInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapItemPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapItemPage Page of SyncMapItemInstance */ public function getPage(string $targetUrl): SyncMapItemPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapItemContext * * @param string $key The `key` value of the Sync Map Item resource to delete. */ public function getContext( string $key ): SyncMapItemContext { return new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapItemList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php000064400000014014150364341760021455 0ustar00solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions'; } /** * Reads SyncMapPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncMapPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapPermissionPage Page of SyncMapPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapPermissionPage Page of SyncMapPermissionInstance */ public function getPage(string $targetUrl): SyncMapPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapPermissionContext * * @param string $identity The application-defined string that uniquely identifies the User's Sync Map Permission resource to delete. */ public function getContext( string $identity ): SyncMapPermissionContext { return new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php000064400000010440150364341760022165 0ustar00solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the SyncMapPermissionInstance * * @param bool $read Whether the identity can read the Sync Map and its Items. Default value is `false`. * @param bool $write Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync Map. Default value is `false`. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php000064400000010163150364341760020735 0ustar00solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Items/' . \rawurlencode($key) .''; } /** * Delete the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Update the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncMapItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php000064400000003164150364341760020170 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php000064400000013511150364341760016742 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($sid) .''; } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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 syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { if (!$this->_syncListPermissions) { $this->_syncListPermissions = new SyncListPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListPermissions; } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { if (!$this->_syncListItems) { $this->_syncListItems = new SyncListItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListItems; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php000064400000003211150364341760021246 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php000064400000005107150364341760021313 0ustar00solution = [ 'serviceSid' => $serviceSid, 'streamSid' => $streamSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Streams/' . \rawurlencode($streamSid) .'/Messages'; } /** * Create the StreamMessageInstance * * @param array $data A JSON string that represents an arbitrary, schema-less object that makes up the Stream Message body. Can be up to 4 KiB in length. * @return StreamMessageInstance Created StreamMessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $data): StreamMessageInstance { $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php000064400000004675150364341760022155 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentInstance.php000064400000012716150364341760017076 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DocumentContext Context for this DocumentInstance */ protected function proxy(): DocumentContext { if (!$this->context) { $this->context = new DocumentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { return $this->proxy()->fetch(); } /** * Update the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DocumentInstance { return $this->proxy()->update($options); } /** * Access the documentPermissions */ protected function getDocumentPermissions(): DocumentPermissionList { return $this->proxy()->documentPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php000064400000012336150364341760017406 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncStreamContext Context for this SyncStreamInstance */ protected function proxy(): SyncStreamContext { if (!$this->context) { $this->context = new SyncStreamContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncStreamInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncStreamInstance * * @return SyncStreamInstance Fetched SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncStreamInstance { return $this->proxy()->fetch(); } /** * Update the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Updated SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncStreamInstance { return $this->proxy()->update($options); } /** * Access the streamMessages */ protected function getStreamMessages(): StreamMessageList { return $this->proxy()->streamMessages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncStreamInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php000064400000012505150364341760016752 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($sid) .''; } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListList.php000064400000014445150364341760016240 0ustar00solution = [ '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'] ); } /** * Reads SyncListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListPage Page of SyncListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListPage Page of SyncListInstance */ public function getPage(string $targetUrl): SyncListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPage($this->version, $response, $this->solution); } /** * Constructs a SyncListContext * * @param string $sid The SID of the Sync List resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. */ public function getContext( string $sid ): SyncListContext { return new SyncListContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListInstance.php000064400000013160150364341760017062 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListContext Context for this SyncListInstance */ protected function proxy(): SyncListContext { if (!$this->context) { $this->context = new SyncListContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { return $this->proxy()->fetch(); } /** * Update the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Updated SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncListInstance { return $this->proxy()->update($options); } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { return $this->proxy()->syncListPermissions; } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { return $this->proxy()->syncListItems; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php000064400000010230150364341760021324 0ustar00solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Items/' . \rawurlencode($index) .''; } /** * Delete the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { $payload = $this->version->fetch('GET', $this->uri); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Update the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncListItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], ]); $headers = Values::of(['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) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php000064400000010420150364341760022557 0ustar00solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the SyncListPermissionInstance * * @param bool $read Whether the identity can read the Sync List and its Items. Default value is `false`. * @param bool $write Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync List. Default value is `false`. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php000064400000012571150364341760022710 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListPermissionContext Context for this SyncListPermissionInstance */ protected function proxy(): SyncListPermissionContext { if (!$this->context) { $this->context = new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { return $this->proxy()->fetch(); } /** * Update the SyncListPermissionInstance * * @param bool $read Whether the identity can read the Sync List and its Items. Default value is `false`. * @param bool $write Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync List. Default value is `false`. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php000064400000040134150364341760021341 0ustar00options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setItemTtl(int $itemTtl): self { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncListItemOptions ' . $options . ']'; } } class DeleteSyncListItemOptions extends Options { /** * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.DeleteSyncListItemOptions ' . $options . ']'; } } class ReadSyncListItemOptions extends Options { /** * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. */ public function __construct( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. * * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * The `index` of the first Sync List Item resource to read. See also `bounds`. * * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. * * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. * @return $this Fluent Builder */ public function setBounds(string $bounds): self { $this->options['bounds'] = $bounds; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.ReadSyncListItemOptions ' . $options . ']'; } } class UpdateSyncListItemOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE, string $ifMatch = Values::NONE ) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; $this->options['ifMatch'] = $ifMatch; } /** * A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setItemTtl(int $itemTtl): self { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncListItemOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php000064400000013775150364341760022066 0ustar00solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Permissions'; } /** * Reads SyncListPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncListPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListPermissionPage Page of SyncListPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListPermissionPage Page of SyncListPermissionInstance */ public function getPage(string $targetUrl): SyncListPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncListPermissionContext * * @param string $identity The application-defined string that uniquely identifies the User's Sync List Permission resource to delete. */ public function getContext( string $identity ): SyncListPermissionContext { return new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php000064400000003241150364341760022012 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php000064400000012621150364341760021452 0ustar00properties = [ 'index' => Values::array_get($payload, 'index'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index ?: $this->properties['index'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListItemContext Context for this SyncListItemInstance */ protected function proxy(): SyncListItemContext { if (!$this->context) { $this->context = new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } return $this->context; } /** * Delete the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { return $this->proxy()->fetch(); } /** * Update the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncListItemInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php000064400000003175150364341760020566 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php000064400000016511150364341760020623 0ustar00solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Items'; } /** * Create the SyncListItemInstance * * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * @param array|Options $options Optional Arguments * @return SyncListItemInstance Created SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $data, array $options = []): SyncListItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($data), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Reads SyncListItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListItemInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SyncListItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListItemInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListItemPage Page of SyncListItemInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListItemPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListItemPage Page of SyncListItemInstance */ public function getPage(string $targetUrl): SyncListItemPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncListItemContext * * @param int $index The index of the Sync List Item resource to delete. */ public function getContext( int $index ): SyncListItemContext { return new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $index ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListItemList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php000064400000012421150364341760017270 0ustar00options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncStreamOptions ' . $options . ']'; } } class UpdateSyncStreamOptions extends Options { /** * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). */ public function __construct( int $ttl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncStreamOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php000064400000011720150364341760017262 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Streams/' . \rawurlencode($sid) .''; } /** * Delete the SyncStreamInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php000064400000003103150364341760016506 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentOptions.php000064400000015715150364341760016767 0ustar00options['uniqueName'] = $uniqueName; $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * An application-defined string that uniquely identifies the Sync Document * * @param string $uniqueName An application-defined string that uniquely identifies the Sync Document * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). * * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateDocumentOptions ' . $options . ']'; } } class UpdateDocumentOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). * @param string $ifMatch The If-Match HTTP request header */ public function __construct( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, string $ifMatch = Values::NONE ) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; $this->options['ifMatch'] = $ifMatch; } /** * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). * * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListPage.php000064400000003067150364341760016177 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php000064400000013412150364341760016544 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($sid) .''; } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php000064400000013102150364341760016660 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapContext Context for this SyncMapInstance */ protected function proxy(): SyncMapContext { if (!$this->context) { $this->context = new SyncMapContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Updated SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncMapInstance { return $this->proxy()->update($options); } /** * Access the syncMapItems */ protected function getSyncMapItems(): SyncMapItemList { return $this->proxy()->syncMapItems; } /** * Access the syncMapPermissions */ protected function getSyncMapPermissions(): SyncMapPermissionList { return $this->proxy()->syncMapPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapList.php000064400000014374150364341760016043 0ustar00solution = [ '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'] ); } /** * Reads SyncMapInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncMapInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapPage Page of SyncMapInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapPage Page of SyncMapInstance */ public function getPage(string $targetUrl): SyncMapPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapContext * * @param string $sid The SID of the Sync Map resource to delete. Can be the Sync Map's `sid` or its `unique_name`. */ public function getContext( string $sid ): SyncMapContext { return new SyncMapContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamList.php000064400000014313150364341760016552 0ustar00solution = [ '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'] ); } /** * Reads SyncStreamInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncStreamInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncStreamInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncStreamInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncStreamPage Page of SyncStreamInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncStreamPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncStreamPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncStreamInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncStreamPage Page of SyncStreamInstance */ public function getPage(string $targetUrl): SyncStreamPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncStreamPage($this->version, $response, $this->solution); } /** * Constructs a SyncStreamContext * * @param string $sid The SID of the Stream resource to delete. */ public function getContext( string $sid ): SyncStreamContext { return new SyncStreamContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncStreamList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapPage.php000064400000003061150364341760015773 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php000064400000003245150364341760022032 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php000064400000010421150364341760022574 0ustar00solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($documentSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the DocumentPermissionInstance * * @param bool $read Whether the identity can read the Sync Document. Default value is `false`. * @param bool $write Whether the identity can update the Sync Document. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync Document. Default value is `false`. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php000064400000012572150364341760022725 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'documentSid' => Values::array_get($payload, 'document_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DocumentPermissionContext Context for this DocumentPermissionInstance */ protected function proxy(): DocumentPermissionContext { if (!$this->context) { $this->context = new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { return $this->proxy()->fetch(); } /** * Update the DocumentPermissionInstance * * @param bool $read Whether the identity can read the Sync Document. Default value is `false`. * @param bool $write Whether the identity can update the Sync Document. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync Document. Default value is `false`. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php000064400000014031150364341760022064 0ustar00solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($documentSid) .'/Permissions'; } /** * Reads DocumentPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DocumentPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DocumentPermissionPage Page of DocumentPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DocumentPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DocumentPermissionPage Page of DocumentPermissionInstance */ public function getPage(string $targetUrl): DocumentPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Constructs a DocumentPermissionContext * * @param string $identity The application-defined string that uniquely identifies the User's Document Permission resource to delete. */ public function getContext( string $identity ): DocumentPermissionContext { return new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.DocumentPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentList.php000064400000014512150364341760016241 0ustar00solution = [ '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'] ); } /** * Reads DocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DocumentPage Page of DocumentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DocumentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DocumentPage Page of DocumentInstance */ public function getPage(string $targetUrl): DocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPage($this->version, $response, $this->solution); } /** * Constructs a DocumentContext * * @param string $sid The SID of the Document resource to delete. Can be the Document resource's `sid` or its `unique_name`. */ public function getContext( string $sid ): DocumentContext { return new DocumentContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.DocumentList]'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceOptions.php000064400000047302150364341760015206 0ustar00options['friendlyName'] = $friendlyName; $this->options['webhookUrl'] = $webhookUrl; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; } /** * A string that you assign to describe the resource. * * @param string $friendlyName A string that you assign to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should call when Sync objects are manipulated. * * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @return $this Fluent Builder */ public function setAclEnabled(bool $aclEnabled): self { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @return $this Fluent Builder */ public function setReachabilityDebouncingEnabled(bool $reachabilityDebouncingEnabled): self { $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; return $this; } /** * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. * * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. * @return $this Fluent Builder */ public function setReachabilityDebouncingWindow(int $reachabilityDebouncingWindow): self { $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; return $this; } /** * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * @return $this Fluent Builder */ public function setWebhooksFromRestEnabled(bool $webhooksFromRestEnabled): self { $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @param string $friendlyName A string that you assign to describe the resource. * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. */ public function __construct( string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE, bool $reachabilityDebouncingEnabled = Values::BOOL_NONE, int $reachabilityDebouncingWindow = Values::INT_NONE, bool $webhooksFromRestEnabled = Values::BOOL_NONE ) { $this->options['webhookUrl'] = $webhookUrl; $this->options['friendlyName'] = $friendlyName; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; } /** * The URL we should call when Sync objects are manipulated. * * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * A string that you assign to describe the resource. * * @param string $friendlyName A string that you assign to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @return $this Fluent Builder */ public function setAclEnabled(bool $aclEnabled): self { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @return $this Fluent Builder */ public function setReachabilityDebouncingEnabled(bool $reachabilityDebouncingEnabled): self { $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; return $this; } /** * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. * * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. * @return $this Fluent Builder */ public function setReachabilityDebouncingWindow(int $reachabilityDebouncingWindow): self { $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; return $this; } /** * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * @return $this Fluent Builder */ public function setWebhooksFromRestEnabled(bool $webhooksFromRestEnabled): self { $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceList.php000064400000014606150364341760014467 0ustar00solution = [ ]; $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 ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Sync/V1/ServicePage.php000064400000003002150364341760014414 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceContext.php000064400000015330150364341760015173 0ustar00solution = [ '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([ '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 syncLists */ protected function getSyncLists(): SyncListList { if (!$this->_syncLists) { $this->_syncLists = new SyncListList( $this->version, $this->solution['sid'] ); } return $this->_syncLists; } /** * Access the syncStreams */ protected function getSyncStreams(): SyncStreamList { if (!$this->_syncStreams) { $this->_syncStreams = new SyncStreamList( $this->version, $this->solution['sid'] ); } return $this->_syncStreams; } /** * Access the documents */ protected function getDocuments(): DocumentList { if (!$this->_documents) { $this->_documents = new DocumentList( $this->version, $this->solution['sid'] ); } return $this->_documents; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { if (!$this->_syncMaps) { $this->_syncMaps = new SyncMapList( $this->version, $this->solution['sid'] ); } return $this->_syncMaps; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceInstance.php000064400000014212150364341760015311 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhooksFromRestEnabled' => Values::array_get($payload, 'webhooks_from_rest_enabled'), 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), 'reachabilityDebouncingEnabled' => Values::array_get($payload, 'reachability_debouncing_enabled'), 'reachabilityDebouncingWindow' => Values::array_get($payload, 'reachability_debouncing_window'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the syncLists */ protected function getSyncLists(): SyncListList { return $this->proxy()->syncLists; } /** * Access the syncStreams */ protected function getSyncStreams(): SyncStreamList { return $this->proxy()->syncStreams; } /** * Access the documents */ protected function getDocuments(): DocumentList { return $this->proxy()->documents; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { return $this->proxy()->syncMaps; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview.php000064400000015647150364341760012460 0ustar00fleets instead. */ protected function getFleets(): \Twilio\Rest\Preview\DeployedDevices\FleetList { echo "fleets is deprecated. Use deployedDevices->fleets instead."; return $this->deployedDevices->fleets; } /** * @deprecated Use deployedDevices->fleets(\$sid) instead. * @param string $sid A string that uniquely identifies the Fleet. */ protected function contextFleets(string $sid): \Twilio\Rest\Preview\DeployedDevices\FleetContext { echo "fleets(\$sid) is deprecated. Use deployedDevices->fleets(\$sid) instead."; return $this->deployedDevices->fleets($sid); } /** * @deprecated Use hostedNumbers->authorizationDocuments instead. */ protected function getAuthorizationDocuments(): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList { echo "authorizationDocuments is deprecated. Use hostedNumbers->authorizationDocuments instead."; return $this->hostedNumbers->authorizationDocuments; } /** * @deprecated Use hostedNumbers->authorizationDocuments(\$sid) instead. * @param string $sid AuthorizationDocument sid. */ protected function contextAuthorizationDocuments(string $sid): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext { echo "authorizationDocuments(\$sid) is deprecated. Use hostedNumbers->authorizationDocuments(\$sid) instead."; return $this->hostedNumbers->authorizationDocuments($sid); } /** * @deprecated Use hostedNumbers->hostedNumberOrders instead. */ protected function getHostedNumberOrders(): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList { echo "hostedNumberOrders is deprecated. Use hostedNumbers->hostedNumberOrders instead."; return $this->hostedNumbers->hostedNumberOrders; } /** * @deprecated Use hostedNumbers->hostedNumberOrders(\$sid) instead * @param string $sid HostedNumberOrder sid. */ protected function contextHostedNumberOrders(string $sid): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext { echo "hostedNumberOrders(\$sid) is deprecated. Use hostedNumbers->hostedNumberOrders(\$sid) instead."; return $this->hostedNumbers->hostedNumberOrders($sid); } /** * @deprecated Use marketplace->availableAddOns instead. */ protected function getAvailableAddOns(): \Twilio\Rest\Preview\Marketplace\AvailableAddOnList { echo "availableAddOns is deprecated. Use marketplace->availableAddOns instead."; return $this->marketplace->availableAddOns; } /** * @deprecated Use marketplace->availableAddOns(\$sid) instead. * @param string $sid The SID of the AvailableAddOn resource to fetch */ protected function contextAvailableAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext { echo "availableAddOns(\$sid) is deprecated. Use marketplace->availableAddOns(\$sid) instead."; return $this->marketplace->availableAddOns($sid); } /** * @deprecated Use marketplace->installedAddOns instead. */ protected function getInstalledAddOns(): \Twilio\Rest\Preview\Marketplace\InstalledAddOnList { echo "installedAddOns is deprecated. Use marketplace->installedAddOns instead."; return $this->marketplace->installedAddOns; } /** * @deprecated Use marketplace->installedAddOns(\$sid) instead. * @param string $sid The SID of the InstalledAddOn resource to fetch */ protected function contextInstalledAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext { echo "installedAddOns(\$sid) is deprecated. Use marketplace->installedAddOns(\$sid) instead."; return $this->marketplace->installedAddOns($sid); } /** * @deprecated Use sync->services instead. */ protected function getServices(): \Twilio\Rest\Preview\Sync\ServiceList { echo "services is deprecated. Use sync->services instead."; return $this->sync->services; } /** * @deprecated Use sync->services(\$sid) instead. * @param string $sid The sid */ protected function contextServices(string $sid): \Twilio\Rest\Preview\Sync\ServiceContext { echo "services(\$sid) is deprecated. Use sync->services(\$sid) instead."; return $this->sync->services($sid); } /** * @deprecated Use understand->assistants instead. */ protected function getAssistants(): \Twilio\Rest\Preview\Understand\AssistantList { echo "assistants is deprecated. Use understand->assistants instead."; return $this->understand->assistants; } /** * @deprecated Use understand->assistants(\$sid) instead. * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextAssistants(string $sid): \Twilio\Rest\Preview\Understand\AssistantContext { echo "assistants(\$sid) is deprecated. Use understand->assistants(\$sid) instead."; return $this->understand->assistants($sid); } /** * @deprecated Use wireless->commands instead. */ protected function getCommands(): \Twilio\Rest\Preview\Wireless\CommandList { echo "commands is deprecated. Use wireless->commands instead."; return $this->wireless->commands; } /** * @deprecated Use wireless->commands(\$sid) instead. * @param string $sid The sid */ protected function contextCommands(string $sid): \Twilio\Rest\Preview\Wireless\CommandContext { echo "commands(\$sid) is deprecated. Use wireless->commands(\$sid) instead."; return $this->wireless->commands($sid); } /** * @deprecated Use wireless->ratePlans instead. */ protected function getRatePlans(): \Twilio\Rest\Preview\Wireless\RatePlanList { echo "ratePlans is deprecated. Use wireless->ratePlans instead."; return $this->wireless->ratePlans; } /** * @deprecated Use wireless->ratePlans(\$sid) instead. * @param string $sid The sid */ protected function contextRatePlans(string $sid): \Twilio\Rest\Preview\Wireless\RatePlanContext { echo "ratePlans(\$sid) is deprecated. Use wireless->ratePlans(\$sid) instead."; return $this->wireless->ratePlans($sid); } /** * @deprecated Use wireless->sims instead. */ protected function getSims(): \Twilio\Rest\Preview\Wireless\SimList { echo "sims is deprecated. Use wireless->sims instead."; return $this->wireless->sims; } /** * @deprecated Use wireless->sims(\$sid) instead. * @param string $sid The sid */ protected function contextSims(string $sid): \Twilio\Rest\Preview\Wireless\SimContext { echo "sims(\$sid) is deprecated. Use wireless->sims(\$sid) instead."; return $this->wireless->sims($sid); } }sdk/src/Twilio/Rest/Api.php000064400000035141150364341760011537 0ustar00v2010->account; } protected function getAccounts(): \Twilio\Rest\Api\V2010\AccountList { return $this->v2010->accounts; } /** * @param string $sid Fetch by unique Account Sid */ protected function contextAccounts(string $sid): \Twilio\Rest\Api\V2010\AccountContext { return $this->v2010->accounts($sid); } /** * @deprecated Use account->addresses instead. */ protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { echo "addresses is deprecated. Use account->addresses instead."; return $this->v2010->account->addresses; } /** * @deprecated Use account->addresses(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextAddresses(string $sid): \Twilio\Rest\Api\V2010\Account\AddressContext { echo "addresses(\$sid) is deprecated. Use account->addresses(\$sid) instead."; return $this->v2010->account->addresses($sid); } /** * @deprecated Use account->applications instead. */ protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { echo "applications is deprecated. Use account->applications instead."; return $this->v2010->account->applications; } /** * @deprecated Use account->applications(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextApplications(string $sid): \Twilio\Rest\Api\V2010\Account\ApplicationContext { echo "applications(\$sid) is deprecated. Use account->applications(\$sid) instead."; return $this->v2010->account->applications($sid); } /** * @deprecated Use account->authorizedConnectApps instead. */ protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { echo "authorizedConnectApps is deprecated. Use account->authorizedConnectApps instead."; return $this->v2010->account->authorizedConnectApps; } /** * @deprecated Use account->authorizedConnectApps(\$connectAppSid) instead. * @param string $connectAppSid The SID of the Connect App to fetch */ protected function contextAuthorizedConnectApps(string $connectAppSid): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext { echo "authorizedConnectApps(\$connectAppSid) is deprecated. Use account->authorizedConnectApps(\$connectAppSid) instead."; return $this->v2010->account->authorizedConnectApps($connectAppSid); } /** * @deprecated Use account->availablePhoneNumbers instead. */ protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { echo "availablePhoneNumbers is deprecated. Use account->availablePhoneNumbers instead."; return $this->v2010->account->availablePhoneNumbers; } /** * @deprecated Use account->availablePhoneNumbers(\$countryCode) instead. * @param string $countryCode The ISO country code of the country to fetch * available phone number information about */ protected function contextAvailablePhoneNumbers(string $countryCode): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext { echo "availablePhoneNumbers(\$countryCode) is deprecated. Use account->availablePhoneNumbers(\$countryCode) instead."; return $this->v2010->account->availablePhoneNumbers($countryCode); } /** * @deprecated Use account->balance instead. */ protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { echo "balance is deprecated. Use account->balance instead."; return $this->v2010->account->balance; } /** * @deprecated Use account->calls instead */ protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { echo "calls is deprecated. Use account->calls instead."; return $this->v2010->account->calls; } /** * @deprecated Use account->calls(\$sid) instead. * @param string $sid The SID of the Call resource to fetch */ protected function contextCalls(string $sid): \Twilio\Rest\Api\V2010\Account\CallContext { echo "calls(\$sid) is deprecated. Use account->calls(\$sid) instead."; return $this->v2010->account->calls($sid); } /** * @deprecated Use account->conferences instead. */ protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { echo "conferences is deprecated. Use account->conferences instead."; return $this->v2010->account->conferences; } /** * @deprecated Use account->conferences(\$sid) instead. * @param string $sid The unique string that identifies this resource */ protected function contextConferences(string $sid): \Twilio\Rest\Api\V2010\Account\ConferenceContext { echo "conferences(\$sid) is deprecated. Use account->conferences(\$sid) instead."; return $this->v2010->account->conferences($sid); } /** * @deprecated Use account->connectApps instead. */ protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { echo "connectApps is deprecated. Use account->connectApps instead."; return $this->v2010->account->connectApps; } /** * @deprecated account->connectApps(\$sid) * @param string $sid The unique string that identifies the resource */ protected function contextConnectApps(string $sid): \Twilio\Rest\Api\V2010\Account\ConnectAppContext { echo "connectApps(\$sid) is deprecated. Use account->connectApps(\$sid) instead."; return $this->v2010->account->connectApps($sid); } /** * @deprecated Use account->incomingPhoneNumbers instead */ protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { echo "incomingPhoneNumbers is deprecated. Use account->incomingPhoneNumbers instead."; return $this->v2010->account->incomingPhoneNumbers; } /** * @deprecated Use account->incomingPhoneNumbers(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextIncomingPhoneNumbers(string $sid): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext { echo "incomingPhoneNumbers(\$sid) is deprecated. Use account->incomingPhoneNumbers(\$sid) instead."; return $this->v2010->account->incomingPhoneNumbers($sid); } /** * @deprecated Use account->keys instead. */ protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { echo "keys is deprecated. Use account->keys instead."; return $this->v2010->account->keys; } /** * @deprecated Use account->keys(\$sid) instead * @param string $sid The unique string that identifies the resource */ protected function contextKeys(string $sid): \Twilio\Rest\Api\V2010\Account\KeyContext { echo "keys(\$sid) is deprecated. Use account->keys(\$sid) instead."; return $this->v2010->account->keys($sid); } /** * @deprecated Use account->messages instead. */ protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { echo "messages is deprecated. Use account->messages instead."; return $this->v2010->account->messages; } /** * @deprecated Use account->messages(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextMessages(string $sid): \Twilio\Rest\Api\V2010\Account\MessageContext { echo "amessages(\$sid) is deprecated. Use account->messages(\$sid) instead."; return $this->v2010->account->messages($sid); } /** * @deprecated Use account->newKeys instead. */ protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { echo "newKeys is deprecated. Use account->newKeys instead."; return $this->v2010->account->newKeys; } /** * @deprecated Use account->newSigningKeys instead. */ protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { echo "newSigningKeys is deprecated. Use account->newSigningKeys instead."; return $this->v2010->account->newSigningKeys; } /** * @deprecated Use account->notifications instead. */ protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { echo "notifications is deprecated. Use account->notifications instead."; return $this->v2010->account->notifications; } /** * @deprecated Use account->notifications(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextNotifications(string $sid): \Twilio\Rest\Api\V2010\Account\NotificationContext { echo "notifications(\$sid) is deprecated. Use account->notifications(\$sid) instead."; return $this->v2010->account->notifications($sid); } /** * @deprecated Use account->outgoingCallerIds instead. */ protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { echo "outgoingCallerIds is deprecated. Use account->outgoingCallerIds instead."; return $this->v2010->account->outgoingCallerIds; } /** * @deprecated Use account->outgoingCallerIds(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextOutgoingCallerIds(string $sid): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext { echo "outgoingCallerIds(\$sid) is deprecated. Use account->outgoingCallerIds(\$sid) instead."; return $this->v2010->account->outgoingCallerIds($sid); } /** * @deprecated Use account->queues instead. */ protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { echo "queues is deprecated. Use account->queues instead."; return $this->v2010->account->queues; } /** * @deprecated Use account->queues(\$sid) instead. * @param string $sid The unique string that identifies this resource */ protected function contextQueues(string $sid): \Twilio\Rest\Api\V2010\Account\QueueContext { echo "queues(\$sid) is deprecated. Use account->queues(\$sid) instead."; return $this->v2010->account->queues($sid); } /** * @deprecated Use account->recordings instead. */ protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { echo "recordings is deprecated. Use account->recordings instead."; return $this->v2010->account->recordings; } /** * @deprecated Use account->recordings(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext { echo "recordings(\$sid) is deprecated. Use account->recordings(\$sid) instead."; return $this->v2010->account->recordings($sid); } /** * @deprecated Use account->signingKeys instead. */ protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { echo "signingKeys is deprecated. Use account->signingKeys instead."; return $this->v2010->account->signingKeys; } /** * @deprecated Use account->signingKeys(\$sid) instead. * @param string $sid The sid */ protected function contextSigningKeys(string $sid): \Twilio\Rest\Api\V2010\Account\SigningKeyContext { echo "signingKeys(\$sid) is deprecated. Use account->signingKeys(\$sid) instead."; return $this->v2010->account->signingKeys($sid); } /** * @deprecated Use account->sip instead. */ protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { echo "sip is deprecated. Use account->sip instead."; return $this->v2010->account->sip; } /** * @deprecated Use account->shortCodes instead. */ protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { echo "shortCodes is deprecated. Use account->shortCodes instead."; return $this->v2010->account->shortCodes; } /** * @deprecated Use account->shortCodes(\$sid) instead. * @param string $sid The unique string that identifies this resource */ protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext { echo "shortCodes(\$sid) is deprecated. Use account->shortCodes(\$sid) instead."; return $this->v2010->account->shortCodes($sid); } /** * @deprecated Use account->token instead. */ protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { echo "tokens is deprecated. Use account->token instead."; return $this->v2010->account->tokens; } /** * @deprecated Use account->transcriptions instead. */ protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { echo "transcriptions is deprecated. Use account->transcriptions instead."; return $this->v2010->account->transcriptions; } /** * @deprecated Use account->transcriptions(\$sid) instead * @param string $sid The unique string that identifies the resource */ protected function contextTranscriptions(string $sid): \Twilio\Rest\Api\V2010\Account\TranscriptionContext { echo "transcriptions(\$sid) is deprecated. Use account->transcriptions(\$sid) instead."; return $this->v2010->account->transcriptions($sid); } /** * @deprecated Use account->usage instead. */ protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { echo "usage is deprecated. Use account->usage instead."; return $this->v2010->account->usage; } /** * @deprecated Use account->validationRequests instead. */ protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { echo "validationRequests is deprecated. Use account->validationRequests instead."; return $this->v2010->account->validationRequests; } }sdk/src/Twilio/Rest/SupersimBase.php000064400000004540150364341760013427 0ustar00baseUrl = 'https://supersim.twilio.com'; } /** * @return V1 Version v1 of supersim */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim]'; } } sdk/src/Twilio/Rest/Video.php000064400000007464150364341760012103 0ustar00compositions instead. */ protected function getCompositions(): \Twilio\Rest\Video\V1\CompositionList { echo "compositions is deprecated. Use v1->compositions instead."; return $this->v1->compositions; } /** * @deprecated Use v1->compositions(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextCompositions(string $sid): \Twilio\Rest\Video\V1\CompositionContext { echo "compositions(\$sid) is deprecated. Use v1->compositions(\$sid) instead."; return $this->v1->compositions($sid); } /** * @deprecated Use v1->compositionHooks instead. */ protected function getCompositionHooks(): \Twilio\Rest\Video\V1\CompositionHookList { echo "compositionHooks is deprecated. Use v1->compositionHooks instead."; return $this->v1->compositionHooks; } /** * @deprecated Use v1->compositionHooks(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextCompositionHooks(string $sid): \Twilio\Rest\Video\V1\CompositionHookContext { echo "compositionHooks(\$sid) is deprecated. Use v1->compositionHooks(\$sid) instead."; return $this->v1->compositionHooks($sid); } /** * @deprecated Use v1->compositionSettings instead. */ protected function getCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsList { echo "compositionSettings is deprecated. Use v1->compositionSettings instead."; return $this->v1->compositionSettings; } /** * @deprecated Use v1->compositionSettings() instead. */ protected function contextCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsContext { echo "compositionSettings() is deprecated. Use v1->compositionSettings() instead."; return $this->v1->compositionSettings(); } /** * @deprecated Use v1->recordings instead. */ protected function getRecordings(): \Twilio\Rest\Video\V1\RecordingList { echo "recordings is deprecated. Use v1->recordings instead."; return $this->v1->recordings; } /** * @deprecated Use v1->recordings(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextRecordings(string $sid): \Twilio\Rest\Video\V1\RecordingContext { echo "recordings(\$sid) is deprecated. Use v1->recordings(\$sid) instead."; return $this->v1->recordings($sid); } /** * @deprecated Use v1->recordingSettings instead. */ protected function getRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsList { echo "recordingSettings is deprecated. Use v1->recordingSettings instead."; return $this->v1->recordingSettings; } /** * @deprecated Use v1->recordingSettings() instead. */ protected function contextRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsContext { echo "recordingSettings() is deprecated. Use v1->recordingSettings() instead."; return $this->v1->recordingSettings(); } /** * @deprecated Use v1->rooms instead. */ protected function getRooms(): \Twilio\Rest\Video\V1\RoomList { echo "rooms is deprecated. Use v1->rooms instead."; return $this->v1->rooms; } /** * @deprecated Use v1->rooms(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextRooms(string $sid): \Twilio\Rest\Video\V1\RoomContext { echo "rooms(\$sid) is deprecated. Use v1->rooms(\$sid) instead."; return $this->v1->rooms($sid); } }sdk/src/Twilio/Rest/Messaging/V1.php000064400000016061150364341760013231 0ustar00version = 'v1'; } protected function getBrandRegistrations(): BrandRegistrationList { if (!$this->_brandRegistrations) { $this->_brandRegistrations = new BrandRegistrationList($this); } return $this->_brandRegistrations; } protected function getDeactivations(): DeactivationsList { if (!$this->_deactivations) { $this->_deactivations = new DeactivationsList($this); } return $this->_deactivations; } protected function getDomainCerts(): DomainCertsList { if (!$this->_domainCerts) { $this->_domainCerts = new DomainCertsList($this); } return $this->_domainCerts; } protected function getDomainConfig(): DomainConfigList { if (!$this->_domainConfig) { $this->_domainConfig = new DomainConfigList($this); } return $this->_domainConfig; } protected function getDomainConfigMessagingService(): DomainConfigMessagingServiceList { if (!$this->_domainConfigMessagingService) { $this->_domainConfigMessagingService = new DomainConfigMessagingServiceList($this); } return $this->_domainConfigMessagingService; } protected function getExternalCampaign(): ExternalCampaignList { if (!$this->_externalCampaign) { $this->_externalCampaign = new ExternalCampaignList($this); } return $this->_externalCampaign; } protected function getLinkshorteningMessagingService(): LinkshorteningMessagingServiceList { if (!$this->_linkshorteningMessagingService) { $this->_linkshorteningMessagingService = new LinkshorteningMessagingServiceList($this); } return $this->_linkshorteningMessagingService; } protected function getLinkshorteningMessagingServiceDomainAssociation(): LinkshorteningMessagingServiceDomainAssociationList { if (!$this->_linkshorteningMessagingServiceDomainAssociation) { $this->_linkshorteningMessagingServiceDomainAssociation = new LinkshorteningMessagingServiceDomainAssociationList($this); } return $this->_linkshorteningMessagingServiceDomainAssociation; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } protected function getTollfreeVerifications(): TollfreeVerificationList { if (!$this->_tollfreeVerifications) { $this->_tollfreeVerifications = new TollfreeVerificationList($this); } return $this->_tollfreeVerifications; } protected function getUsecases(): UsecaseList { if (!$this->_usecases) { $this->_usecases = new UsecaseList($this); } return $this->_usecases; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1]'; } } sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignPage.php000064400000003114150364341760017243 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.php000064400000101042150364341760020716 0ustar00options['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 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 UpdateTollfreeVerificationOptions extends Options { /** * @param string $businessName The name of the business or organization using the Tollfree number. * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @param string $notificationEmail The email address to receive the notification about the verification result. . * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @param string $productionMessageSample An example of message content, i.e. a sample message. * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @param string $optInType * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @param string $businessCity The city of the business or organization using the Tollfree number. * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @param string $businessCountry The country of the business or organization using the Tollfree number. * @param string $additionalInformation Additional information to be provided for verification. * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @param string $businessContactPhone The 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 Use this to further explain how messaging is used by the business or organization. * @return $this Fluent Builder */ public function setUseCaseSummary(string $useCaseSummary): self { $this->options['useCaseSummary'] = $useCaseSummary; return $this; } /** * An example of message content, i.e. a sample message. * * @param string $productionMessageSample An example of message content, i.e. a sample message. * @return $this Fluent Builder */ public function setProductionMessageSample(string $productionMessageSample): self { $this->options['productionMessageSample'] = $productionMessageSample; return $this; } /** * Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @return $this Fluent Builder */ public function setOptInImageUrls(array $optInImageUrls): self { $this->options['optInImageUrls'] = $optInImageUrls; return $this; } /** * @param string $optInType * @return $this Fluent Builder */ public function setOptInType(string $optInType): self { $this->options['optInType'] = $optInType; return $this; } /** * Estimate monthly volume of messages from the Tollfree Number. * * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @return $this Fluent Builder */ public function setMessageVolume(string $messageVolume): self { $this->options['messageVolume'] = $messageVolume; return $this; } /** * The address of the business or organization using the Tollfree number. * * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStreetAddress(string $businessStreetAddress): self { $this->options['businessStreetAddress'] = $businessStreetAddress; return $this; } /** * The address of the business or organization using the Tollfree number. * * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStreetAddress2(string $businessStreetAddress2): self { $this->options['businessStreetAddress2'] = $businessStreetAddress2; return $this; } /** * The city of the business or organization using the Tollfree number. * * @param string $businessCity The city of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessCity(string $businessCity): self { $this->options['businessCity'] = $businessCity; return $this; } /** * The state/province/region of the business or organization using the Tollfree number. * * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self { $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; return $this; } /** * The postal code of the business or organization using the Tollfree number. * * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessPostalCode(string $businessPostalCode): self { $this->options['businessPostalCode'] = $businessPostalCode; return $this; } /** * The country of the business or organization using the Tollfree number. * * @param string $businessCountry The country of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessCountry(string $businessCountry): self { $this->options['businessCountry'] = $businessCountry; return $this; } /** * Additional information to be provided for verification. * * @param string $additionalInformation Additional information to be provided for verification. * @return $this Fluent Builder */ public function setAdditionalInformation(string $additionalInformation): self { $this->options['additionalInformation'] = $additionalInformation; return $this; } /** * The first name of the contact for the business or organization using the Tollfree number. * * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactFirstName(string $businessContactFirstName): self { $this->options['businessContactFirstName'] = $businessContactFirstName; return $this; } /** * The last name of the contact for the business or organization using the Tollfree number. * * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactLastName(string $businessContactLastName): self { $this->options['businessContactLastName'] = $businessContactLastName; return $this; } /** * The email address of the contact for the business or organization using the Tollfree number. * * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactEmail(string $businessContactEmail): self { $this->options['businessContactEmail'] = $businessContactEmail; return $this; } /** * The phone number of the contact for the business or organization using the Tollfree number. * * @param string $businessContactPhone The phone number of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactPhone(string $businessContactPhone): self { $this->options['businessContactPhone'] = $businessContactPhone; return $this; } /** * 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 . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceInstance.php000064400000010574150364341760022435 0ustar00properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'configSid' => Values::array_get($payload, 'config_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'continueOnFailure' => Values::array_get($payload, 'continue_on_failure'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DomainConfigMessagingServiceContext Context for this DomainConfigMessagingServiceInstance */ protected function proxy(): DomainConfigMessagingServiceContext { if (!$this->context) { $this->context = new DomainConfigMessagingServiceContext( $this->version, $this->solution['messagingServiceSid'] ); } return $this->context; } /** * Fetch the DomainConfigMessagingServiceInstance * * @return DomainConfigMessagingServiceInstance Fetched DomainConfigMessagingServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigMessagingServiceInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainConfigMessagingServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php000064400000003121150364341760017311 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php000064400000003135150364341760017646 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderList.php000064400000013072150364341760020175 0ustar00solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) .'/ChannelSenders'; } /** * Reads ChannelSenderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelSenderInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ChannelSenderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelSenderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelSenderPage Page of ChannelSenderInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelSenderPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelSenderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelSenderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelSenderPage Page of ChannelSenderInstance */ public function getPage(string $targetUrl): ChannelSenderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelSenderPage($this->version, $response, $this->solution); } /** * Constructs a ChannelSenderContext * * @param string $sid The SID of the ChannelSender resource to fetch. */ public function getContext( string $sid ): ChannelSenderContext { return new ChannelSenderContext( $this->version, $this->solution['messagingServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ChannelSenderList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php000064400000010774150364341760020545 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php000064400000014476150364341760017663 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/AlphaSenders'; } /** * Create the AlphaSenderInstance * * @param string $alphaSender The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers. * @return AlphaSenderInstance Created AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $alphaSender): AlphaSenderInstance { $data = Values::of([ 'AlphaSender' => $alphaSender, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AlphaSenderInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads AlphaSenderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AlphaSenderInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AlphaSenderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AlphaSenderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AlphaSenderPage Page of AlphaSenderInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AlphaSenderPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AlphaSenderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AlphaSenderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AlphaSenderPage Page of AlphaSenderInstance */ public function getPage(string $targetUrl): AlphaSenderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AlphaSenderPage($this->version, $response, $this->solution); } /** * Constructs a AlphaSenderContext * * @param string $sid The SID of the AlphaSender resource to delete. */ public function getContext( string $sid ): AlphaSenderContext { return new AlphaSenderContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.AlphaSenderList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php000064400000021167150364341760020212 0ustar00solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) .'/Compliance/Usa2p'; } /** * Create the UsAppToPersonInstance * * @param string $brandRegistrationSid A2P Brand Registration SID * @param string $description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. * @param string $messageFlow Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. * @param string[] $messageSamples An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. * @param string $usAppToPersonUsecase A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] * @param bool $hasEmbeddedLinks Indicates that this SMS campaign will send messages that contain links. * @param bool $hasEmbeddedPhone Indicates that this SMS campaign will send messages that contain phone numbers. * @param array|Options $options Optional Arguments * @return UsAppToPersonInstance Created UsAppToPersonInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $brandRegistrationSid, string $description, string $messageFlow, array $messageSamples, string $usAppToPersonUsecase, bool $hasEmbeddedLinks, bool $hasEmbeddedPhone, array $options = []): UsAppToPersonInstance { $options = new Values($options); $data = Values::of([ 'BrandRegistrationSid' => $brandRegistrationSid, 'Description' => $description, 'MessageFlow' => $messageFlow, 'MessageSamples' => Serialize::map($messageSamples,function ($e) { return $e; }), 'UsAppToPersonUsecase' => $usAppToPersonUsecase, 'HasEmbeddedLinks' => Serialize::booleanToString($hasEmbeddedLinks), 'HasEmbeddedPhone' => Serialize::booleanToString($hasEmbeddedPhone), 'OptInMessage' => $options['optInMessage'], 'OptOutMessage' => $options['optOutMessage'], 'HelpMessage' => $options['helpMessage'], 'OptInKeywords' => Serialize::map($options['optInKeywords'], function ($e) { return $e; }), 'OptOutKeywords' => Serialize::map($options['optOutKeywords'], function ($e) { return $e; }), 'HelpKeywords' => Serialize::map($options['helpKeywords'], function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UsAppToPersonInstance( $this->version, $payload, $this->solution['messagingServiceSid'] ); } /** * Reads UsAppToPersonInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsAppToPersonInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UsAppToPersonInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UsAppToPersonInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UsAppToPersonPage Page of UsAppToPersonInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UsAppToPersonPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UsAppToPersonPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsAppToPersonInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UsAppToPersonPage Page of UsAppToPersonInstance */ public function getPage(string $targetUrl): UsAppToPersonPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsAppToPersonPage($this->version, $response, $this->solution); } /** * Constructs a UsAppToPersonContext * * @param string $sid The SID of the US A2P Compliance resource to delete `QE2c6890da8086d771620e9b13fadeba0b`. */ public function getContext( string $sid ): UsAppToPersonContext { return new UsAppToPersonContext( $this->version, $this->solution['messagingServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsAppToPersonList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php000064400000005314150364341760020717 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonInstance.php000064400000015022150364341760021034 0ustar00properties = [ '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'), 'errors' => Values::array_get($payload, 'errors'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UsAppToPersonContext Context for this UsAppToPersonInstance */ protected function proxy(): UsAppToPersonContext { if (!$this->context) { $this->context = new UsAppToPersonContext( $this->version, $this->solution['messagingServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UsAppToPersonInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UsAppToPersonInstance * * @return UsAppToPersonInstance Fetched UsAppToPersonInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UsAppToPersonInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.php000064400000031772150364341760020735 0ustar00options['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 If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. * @return $this Fluent Builder */ public function setOptInMessage(string $optInMessage): self { $this->options['optInMessage'] = $optInMessage; return $this; } /** * Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * * @param string $optOutMessage Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * @return $this Fluent Builder */ public function setOptOutMessage(string $optOutMessage): self { $this->options['optOutMessage'] = $optOutMessage; return $this; } /** * When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * * @param string $helpMessage When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * @return $this Fluent Builder */ public function setHelpMessage(string $helpMessage): self { $this->options['helpMessage'] = $helpMessage; return $this; } /** * If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. * * @param string[] $optInKeywords If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. * @return $this Fluent Builder */ public function setOptInKeywords(array $optInKeywords): self { $this->options['optInKeywords'] = $optInKeywords; return $this; } /** * End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * * @param string[] $optOutKeywords End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * @return $this Fluent Builder */ public function setOptOutKeywords(array $optOutKeywords): self { $this->options['optOutKeywords'] = $optOutKeywords; return $this; } /** * End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * * @param string[] $helpKeywords End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * @return $this Fluent Builder */ public function setHelpKeywords(array $helpKeywords): self { $this->options['helpKeywords'] = $helpKeywords; return $this; } /** * 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 . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php000064400000005107150364341760020417 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php000064400000014263150364341760017711 0ustar00solution = [ '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'] ); } /** * Reads PhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PhoneNumberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PhoneNumberPage Page of PhoneNumberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PhoneNumberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PhoneNumberPage Page of PhoneNumberInstance */ public function getPage(string $targetUrl): PhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a PhoneNumberContext * * @param string $sid The SID of the PhoneNumber resource to delete. */ public function getContext( string $sid ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderInstance.php000064400000010465150364341760021031 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'sender' => Values::array_get($payload, 'sender'), 'senderType' => Values::array_get($payload, 'sender_type'), 'countryCode' => Values::array_get($payload, 'country_code'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelSenderContext Context for this ChannelSenderInstance */ protected function proxy(): ChannelSenderContext { if (!$this->context) { $this->context = new ChannelSenderContext( $this->version, $this->solution['messagingServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ChannelSenderInstance * * @return ChannelSenderInstance Fetched ChannelSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelSenderInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ChannelSenderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php000064400000010614150364341760020502 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'alphaSender' => Values::array_get($payload, 'alpha_sender'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AlphaSenderContext Context for this AlphaSenderInstance */ protected function proxy(): AlphaSenderContext { if (!$this->context) { $this->context = new AlphaSenderContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AlphaSenderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AlphaSenderInstance * * @return AlphaSenderInstance Fetched AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AlphaSenderInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.AlphaSenderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderPage.php000064400000003162150364341760020135 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return ChannelSenderInstance \Twilio\Rest\Messaging\V1\Service\ChannelSenderInstance */ public function buildInstance(array $payload): ChannelSenderInstance { return new ChannelSenderInstance($this->version, $payload, $this->solution['messagingServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ChannelSenderPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonPage.php000064400000003162150364341760020146 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseInstance.php000064400000004473150364341760022355 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php000064400000010734150364341760020211 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecasePage.php000064400000003234150364341760021457 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php000064400000004603150364341760021517 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php000064400000005107150364341760020363 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/AlphaSenders/' . \rawurlencode($sid) .''; } /** * Delete the AlphaSenderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php000064400000005061150364341760020066 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php000064400000004553150364341760020712 0ustar00solution = [ 'messagingServiceSid' => $messagingServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) .'/ChannelSenders/' . \rawurlencode($sid) .''; } /** * Fetch the ChannelSenderInstance * * @return ChannelSenderInstance Fetched ChannelSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelSenderInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChannelSenderInstance( $this->version, $payload, $this->solution['messagingServiceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ChannelSenderContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseOptions.php000064400000004114150364341760022234 0ustar00options['brandRegistrationSid'] = $brandRegistrationSid; } /** * The unique string to identify the A2P brand. * * @param string $brandRegistrationSid The unique string to identify the A2P brand. * @return $this Fluent Builder */ public function setBrandRegistrationSid(string $brandRegistrationSid): self { $this->options['brandRegistrationSid'] = $brandRegistrationSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.FetchUsAppToPersonUsecaseOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php000064400000003135150364341760017612 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php000064400000014175150364341760017363 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/ShortCodes'; } /** * Create the ShortCodeInstance * * @param string $shortCodeSid The SID of the ShortCode resource being added to the Service. * @return ShortCodeInstance Created ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $shortCodeSid): ShortCodeInstance { $data = Values::of([ 'ShortCodeSid' => $shortCodeSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ShortCodeInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads ShortCodeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ShortCodeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ShortCodePage Page of ShortCodeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ShortCodePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ShortCodePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ShortCodeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ShortCodePage Page of ShortCodeInstance */ public function getPage(string $targetUrl): ShortCodePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Constructs a ShortCodeContext * * @param string $sid The SID of the ShortCode resource to delete. */ public function getContext( string $sid ): ShortCodeContext { return new ShortCodeContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ShortCodeList]'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceInstance.php000064400000010563150364341760023074 0ustar00properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], 'messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return LinkshorteningMessagingServiceContext Context for this LinkshorteningMessagingServiceInstance */ protected function proxy(): LinkshorteningMessagingServiceContext { if (!$this->context) { $this->context = new LinkshorteningMessagingServiceContext( $this->version, $this->solution['domainSid'], $this->solution['messagingServiceSid'] ); } return $this->context; } /** * Create the LinkshorteningMessagingServiceInstance * * @return LinkshorteningMessagingServiceInstance Created LinkshorteningMessagingServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): LinkshorteningMessagingServiceInstance { return $this->proxy()->create(); } /** * Delete the LinkshorteningMessagingServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignInstance.php000064400000005000150364341760020127 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsOptions.php000064400000004570150364341760017404 0ustar00options['date'] = $date; } /** * The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. * * @param \DateTime $date The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. * @return $this Fluent Builder */ public function setDate(\DateTime $date): self { $this->options['date'] = $date; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.FetchDeactivationsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationPage.php000064400000003406150364341760025527 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return LinkshorteningMessagingServiceDomainAssociationInstance \Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceDomainAssociationInstance */ public function buildInstance(array $payload): LinkshorteningMessagingServiceDomainAssociationInstance { return new LinkshorteningMessagingServiceDomainAssociationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigPage.php000064400000003064150364341760016362 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceOptions.php000064400000112645150364341760016212 0ustar00options['inboundRequestUrl'] = $inboundRequestUrl; $this->options['inboundMethod'] = $inboundMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['stickySender'] = $stickySender; $this->options['mmsConverter'] = $mmsConverter; $this->options['smartEncoding'] = $smartEncoding; $this->options['scanMessageContent'] = $scanMessageContent; $this->options['fallbackToLongCode'] = $fallbackToLongCode; $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; $this->options['validityPeriod'] = $validityPeriod; $this->options['synchronousValidation'] = $synchronousValidation; $this->options['usecase'] = $usecase; $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; } /** * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setInboundRequestUrl(string $inboundRequestUrl): self { $this->options['inboundRequestUrl'] = $inboundRequestUrl; return $this; } /** * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setInboundMethod(string $inboundMethod): self { $this->options['inboundMethod'] = $inboundMethod; return $this; } /** * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setFallbackMethod(string $fallbackMethod): self { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @return $this Fluent Builder */ public function setStickySender(bool $stickySender): self { $this->options['stickySender'] = $stickySender; return $this; } /** * Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @return $this Fluent Builder */ public function setMmsConverter(bool $mmsConverter): self { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @return $this Fluent Builder */ public function setSmartEncoding(bool $smartEncoding): self { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * @param string $scanMessageContent * @return $this Fluent Builder */ public function setScanMessageContent(string $scanMessageContent): self { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @return $this Fluent Builder */ public function setFallbackToLongCode(bool $fallbackToLongCode): self { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @return $this Fluent Builder */ public function setAreaCodeGeomatch(bool $areaCodeGeomatch): self { $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; return $this; } /** * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @return $this Fluent Builder */ public function setValidityPeriod(int $validityPeriod): self { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved. * * @param bool $synchronousValidation Reserved. * @return $this Fluent Builder */ public function setSynchronousValidation(bool $synchronousValidation): self { $this->options['synchronousValidation'] = $synchronousValidation; return $this; } /** * A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @return $this Fluent Builder */ public function setUsecase(string $usecase): self { $this->options['usecase'] = $usecase; return $this; } /** * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setUseInboundWebhookOnNumber(bool $useInboundWebhookOnNumber): self { $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @param string $scanMessageContent * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @param bool $synchronousValidation Reserved. * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. */ public function __construct( string $friendlyName = Values::NONE, string $inboundRequestUrl = Values::NONE, string $inboundMethod = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, bool $stickySender = Values::BOOL_NONE, bool $mmsConverter = Values::BOOL_NONE, bool $smartEncoding = Values::BOOL_NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::BOOL_NONE, bool $areaCodeGeomatch = Values::BOOL_NONE, int $validityPeriod = Values::INT_NONE, bool $synchronousValidation = Values::BOOL_NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['inboundRequestUrl'] = $inboundRequestUrl; $this->options['inboundMethod'] = $inboundMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['stickySender'] = $stickySender; $this->options['mmsConverter'] = $mmsConverter; $this->options['smartEncoding'] = $smartEncoding; $this->options['scanMessageContent'] = $scanMessageContent; $this->options['fallbackToLongCode'] = $fallbackToLongCode; $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; $this->options['validityPeriod'] = $validityPeriod; $this->options['synchronousValidation'] = $synchronousValidation; $this->options['usecase'] = $usecase; $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setInboundRequestUrl(string $inboundRequestUrl): self { $this->options['inboundRequestUrl'] = $inboundRequestUrl; return $this; } /** * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setInboundMethod(string $inboundMethod): self { $this->options['inboundMethod'] = $inboundMethod; return $this; } /** * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setFallbackMethod(string $fallbackMethod): self { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @return $this Fluent Builder */ public function setStickySender(bool $stickySender): self { $this->options['stickySender'] = $stickySender; return $this; } /** * Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @return $this Fluent Builder */ public function setMmsConverter(bool $mmsConverter): self { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @return $this Fluent Builder */ public function setSmartEncoding(bool $smartEncoding): self { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * @param string $scanMessageContent * @return $this Fluent Builder */ public function setScanMessageContent(string $scanMessageContent): self { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @return $this Fluent Builder */ public function setFallbackToLongCode(bool $fallbackToLongCode): self { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @return $this Fluent Builder */ public function setAreaCodeGeomatch(bool $areaCodeGeomatch): self { $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; return $this; } /** * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @return $this Fluent Builder */ public function setValidityPeriod(int $validityPeriod): self { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved. * * @param bool $synchronousValidation Reserved. * @return $this Fluent Builder */ public function setSynchronousValidation(bool $synchronousValidation): self { $this->options['synchronousValidation'] = $synchronousValidation; return $this; } /** * A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @return $this Fluent Builder */ public function setUsecase(string $usecase): self { $this->options['usecase'] = $usecase; return $this; } /** * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setUseInboundWebhookOnNumber(bool $useInboundWebhookOnNumber): self { $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceList.php000064400000004032150364341760022235 0ustar00solution = [ ]; } /** * Constructs a LinkshorteningMessagingServiceContext * * @param string $domainSid The domain SID to associate with a messaging service. With URL shortening enabled, links in messages sent with the associated messaging service will be shortened to the provided domain * * @param string $messagingServiceSid A messaging service SID to associate with a domain. With URL shortening enabled, links in messages sent with the provided messaging service will be shortened to the associated domain */ public function getContext( string $domainSid , string $messagingServiceSid ): LinkshorteningMessagingServiceContext { return new LinkshorteningMessagingServiceContext( $this->version, $domainSid, $messagingServiceSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceList]'; } } sdk/src/Twilio/Rest/Messaging/V1/UsecasePage.php000064400000003026150364341760015413 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php000064400000004157150364341760017376 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainCertsPage.php000064400000003056150364341760016236 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php000064400000004442150364341760022312 0ustar00solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/LinkShortening/MessagingService/' . \rawurlencode($messagingServiceSid) .'/DomainConfig'; } /** * Fetch the DomainConfigMessagingServiceInstance * * @return DomainConfigMessagingServiceInstance Fetched DomainConfigMessagingServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigMessagingServiceInstance { $payload = $this->version->fetch('GET', $this->uri); return new DomainConfigMessagingServiceInstance( $this->version, $payload, $this->solution['messagingServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainConfigMessagingServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationInstance.php000064400000007526150364341760026426 0ustar00properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return LinkshorteningMessagingServiceDomainAssociationContext Context for this LinkshorteningMessagingServiceDomainAssociationInstance */ protected function proxy(): LinkshorteningMessagingServiceDomainAssociationContext { if (!$this->context) { $this->context = new LinkshorteningMessagingServiceDomainAssociationContext( $this->version, $this->solution['messagingServiceSid'] ); } return $this->context; } /** * Fetch the LinkshorteningMessagingServiceDomainAssociationInstance * * @return LinkshorteningMessagingServiceDomainAssociationInstance Fetched LinkshorteningMessagingServiceDomainAssociationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): LinkshorteningMessagingServiceDomainAssociationInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationInstance.php000064400000014251150364341760020336 0ustar00properties = [ '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 brandRegistrationOtps */ protected function getBrandRegistrationOtps(): BrandRegistrationOtpList { return $this->proxy()->brandRegistrationOtps; } /** * Access the brandVettings */ protected function getBrandVettings(): BrandVettingList { return $this->proxy()->brandVettings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.BrandRegistrationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationPage.php000064400000003122150364341760017441 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServicePage.php000064400000003240150364341760022176 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return LinkshorteningMessagingServiceInstance \Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceInstance */ public function buildInstance(array $payload): LinkshorteningMessagingServiceInstance { return new LinkshorteningMessagingServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.LinkshorteningMessagingServicePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceList.php000064400000016356150364341760015474 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'InboundRequestUrl' => $options['inboundRequestUrl'], 'InboundMethod' => $options['inboundMethod'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StickySender' => Serialize::booleanToString($options['stickySender']), 'MmsConverter' => Serialize::booleanToString($options['mmsConverter']), 'SmartEncoding' => Serialize::booleanToString($options['smartEncoding']), 'ScanMessageContent' => $options['scanMessageContent'], 'FallbackToLongCode' => Serialize::booleanToString($options['fallbackToLongCode']), 'AreaCodeGeomatch' => Serialize::booleanToString($options['areaCodeGeomatch']), 'ValidityPeriod' => $options['validityPeriod'], 'SynchronousValidation' => Serialize::booleanToString($options['synchronousValidation']), 'Usecase' => $options['usecase'], 'UseInboundWebhookOnNumber' => Serialize::booleanToString($options['useInboundWebhookOnNumber']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsPage.php000064400000003072150364341760016621 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsList.php000064400000002562150364341760016663 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php000064400000006253150364341760017010 0ustar00solution = [ 'domainSid' => $domainSid, ]; $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) .'/Certificate'; } /** * Delete the DomainCertsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Update the DomainCertsInstance * * @param string $tlsCert Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. * @return DomainCertsInstance Updated DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $tlsCert): DomainCertsInstance { $data = Values::of([ 'TlsCert' => $tlsCert, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DomainCertsInstance( $this->version, $payload, $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainCertsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigInstance.php000064400000010767150364341760017262 0ustar00properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'configSid' => Values::array_get($payload, 'config_sid'), 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'continueOnFailure' => Values::array_get($payload, 'continue_on_failure'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'disableHttps' => Values::array_get($payload, 'disable_https'), ]; $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DomainConfigContext Context for this DomainConfigInstance */ protected function proxy(): DomainConfigContext { if (!$this->context) { $this->context = new DomainConfigContext( $this->version, $this->solution['domainSid'] ); } return $this->context; } /** * Fetch the DomainConfigInstance * * @return DomainConfigInstance Fetched DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigInstance { return $this->proxy()->fetch(); } /** * Update the DomainConfigInstance * * @param array|Options $options Optional Arguments * @return DomainConfigInstance Updated DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DomainConfigInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainConfigInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationPage.php000064400000003144150364341760020143 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServicePage.php000064400000003224150364341760021537 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return DomainConfigMessagingServiceInstance \Twilio\Rest\Messaging\V1\DomainConfigMessagingServiceInstance */ public function buildInstance(array $payload): DomainConfigMessagingServiceInstance { return new DomainConfigMessagingServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DomainConfigMessagingServicePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignList.php000064400000004237150364341760017311 0ustar00solution = [ ]; $this->uri = '/Services/PreregisteredUsa2p'; } /** * Create the ExternalCampaignInstance * * @param string $campaignId ID of the preregistered campaign. * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. * @return ExternalCampaignInstance Created ExternalCampaignInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $campaignId, string $messagingServiceSid): ExternalCampaignInstance { $data = Values::of([ 'CampaignId' => $campaignId, 'MessagingServiceSid' => $messagingServiceSid, ]); $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationList.php000064400000023103150364341760020177 0ustar00solution = [ ]; $this->uri = '/Tollfree/Verifications'; } /** * Create the TollfreeVerificationInstance * * @param string $businessName The name of the business or organization using the Tollfree number. * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @param string $notificationEmail The email address to receive the notification about the verification result. . * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @param string $productionMessageSample An example of message content, i.e. a sample message. * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @param string $optInType * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. * @param array|Options $options Optional Arguments * @return TollfreeVerificationInstance Created TollfreeVerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $businessName, string $businessWebsite, string $notificationEmail, array $useCaseCategories, string $useCaseSummary, string $productionMessageSample, array $optInImageUrls, string $optInType, string $messageVolume, string $tollfreePhoneNumberSid, array $options = []): TollfreeVerificationInstance { $options = new Values($options); $data = Values::of([ 'BusinessName' => $businessName, 'BusinessWebsite' => $businessWebsite, 'NotificationEmail' => $notificationEmail, 'UseCaseCategories' => Serialize::map($useCaseCategories,function ($e) { return $e; }), 'UseCaseSummary' => $useCaseSummary, 'ProductionMessageSample' => $productionMessageSample, 'OptInImageUrls' => Serialize::map($optInImageUrls,function ($e) { return $e; }), 'OptInType' => $optInType, 'MessageVolume' => $messageVolume, 'TollfreePhoneNumberSid' => $tollfreePhoneNumberSid, 'CustomerProfileSid' => $options['customerProfileSid'], 'BusinessStreetAddress' => $options['businessStreetAddress'], 'BusinessStreetAddress2' => $options['businessStreetAddress2'], 'BusinessCity' => $options['businessCity'], 'BusinessStateProvinceRegion' => $options['businessStateProvinceRegion'], 'BusinessPostalCode' => $options['businessPostalCode'], 'BusinessCountry' => $options['businessCountry'], 'AdditionalInformation' => $options['additionalInformation'], 'BusinessContactFirstName' => $options['businessContactFirstName'], 'BusinessContactLastName' => $options['businessContactLastName'], 'BusinessContactEmail' => $options['businessContactEmail'], 'BusinessContactPhone' => $options['businessContactPhone'], 'ExternalReferenceId' => $options['externalReferenceId'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TollfreeVerificationInstance( $this->version, $payload ); } /** * Reads TollfreeVerificationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TollfreeVerificationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TollfreeVerificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TollfreeVerificationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TollfreeVerificationPage Page of TollfreeVerificationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TollfreeVerificationPage { $options = new Values($options); $params = Values::of([ 'TollfreePhoneNumberSid' => $options['tollfreePhoneNumberSid'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TollfreeVerificationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TollfreeVerificationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TollfreeVerificationPage Page of TollfreeVerificationInstance */ public function getPage(string $targetUrl): TollfreeVerificationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TollfreeVerificationPage($this->version, $response, $this->solution); } /** * Constructs a TollfreeVerificationContext * * @param string $sid The unique string to identify Tollfree Verification. */ public function getContext( string $sid ): TollfreeVerificationContext { return new TollfreeVerificationContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.TollfreeVerificationList]'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationInstance.php000064400000017630150364341760021040 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'regulatedItemSid' => Values::array_get($payload, 'regulated_item_sid'), 'businessName' => Values::array_get($payload, 'business_name'), 'businessStreetAddress' => Values::array_get($payload, 'business_street_address'), 'businessStreetAddress2' => Values::array_get($payload, 'business_street_address2'), 'businessCity' => Values::array_get($payload, 'business_city'), 'businessStateProvinceRegion' => Values::array_get($payload, 'business_state_province_region'), 'businessPostalCode' => Values::array_get($payload, 'business_postal_code'), 'businessCountry' => Values::array_get($payload, 'business_country'), 'businessWebsite' => Values::array_get($payload, 'business_website'), 'businessContactFirstName' => Values::array_get($payload, 'business_contact_first_name'), 'businessContactLastName' => Values::array_get($payload, 'business_contact_last_name'), 'businessContactEmail' => Values::array_get($payload, 'business_contact_email'), 'businessContactPhone' => Values::array_get($payload, 'business_contact_phone'), 'notificationEmail' => Values::array_get($payload, 'notification_email'), 'useCaseCategories' => Values::array_get($payload, 'use_case_categories'), 'useCaseSummary' => Values::array_get($payload, 'use_case_summary'), 'productionMessageSample' => Values::array_get($payload, 'production_message_sample'), 'optInImageUrls' => Values::array_get($payload, 'opt_in_image_urls'), 'optInType' => Values::array_get($payload, 'opt_in_type'), 'messageVolume' => Values::array_get($payload, 'message_volume'), 'additionalInformation' => Values::array_get($payload, 'additional_information'), 'tollfreePhoneNumberSid' => Values::array_get($payload, 'tollfree_phone_number_sid'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'rejectionReason' => Values::array_get($payload, 'rejection_reason'), 'errorCode' => Values::array_get($payload, 'error_code'), 'editExpiration' => Deserialize::dateTime(Values::array_get($payload, 'edit_expiration')), '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ServicePage.php000064400000003026150364341760015423 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingInstance.php000064400000010662150364341760022727 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php000064400000004527150364341760022612 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingPage.php000064400000003165150364341760022037 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpInstance.php000064400000004546150364341760024450 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'brandRegistrationSid' => Values::array_get($payload, 'brand_registration_sid'), ]; $this->solution = ['brandRegistrationSid' => $brandRegistrationSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationOtpInstance]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpPage.php000064400000003261150364341760023551 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return BrandRegistrationOtpInstance \Twilio\Rest\Messaging\V1\BrandRegistration\BrandRegistrationOtpInstance */ public function buildInstance(array $payload): BrandRegistrationOtpInstance { return new BrandRegistrationOtpInstance($this->version, $payload, $this->solution['brandRegistrationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationOtpPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php000064400000004037150364341760023612 0ustar00solution = [ 'brandRegistrationSid' => $brandRegistrationSid, ]; $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandRegistrationSid) .'/SmsOtp'; } /** * Create the BrandRegistrationOtpInstance * * @return BrandRegistrationOtpInstance Created BrandRegistrationOtpInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): BrandRegistrationOtpInstance { $payload = $this->version->create('POST', $this->uri); return new BrandRegistrationOtpInstance( $this->version, $payload, $this->solution['brandRegistrationSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationOtpList]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingList.php000064400000015253150364341760022077 0ustar00solution = [ 'brandSid' => $brandSid, ]; $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandSid) .'/Vettings'; } /** * Create the BrandVettingInstance * * @param string $vettingProvider * @param array|Options $options Optional Arguments * @return BrandVettingInstance Created BrandVettingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $vettingProvider, array $options = []): BrandVettingInstance { $options = new Values($options); $data = Values::of([ 'VettingProvider' => $vettingProvider, 'VettingId' => $options['vettingId'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BrandVettingInstance( $this->version, $payload, $this->solution['brandSid'] ); } /** * Reads BrandVettingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BrandVettingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BrandVettingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BrandVettingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BrandVettingPage Page of BrandVettingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BrandVettingPage { $options = new Values($options); $params = Values::of([ 'VettingProvider' => $options['vettingProvider'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BrandVettingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BrandVettingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BrandVettingPage Page of BrandVettingInstance */ public function getPage(string $targetUrl): BrandVettingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BrandVettingPage($this->version, $response, $this->solution); } /** * Constructs a BrandVettingContext * * @param string $brandVettingSid The Twilio SID of the third-party vetting record. */ public function getContext( string $brandVettingSid ): BrandVettingContext { return new BrandVettingContext( $this->version, $this->solution['brandSid'], $brandVettingSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandVettingList]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingOptions.php000064400000006337150364341760022622 0ustar00options['vettingId'] = $vettingId; } /** * The unique ID of the vetting * * @param string $vettingId The unique ID of the vetting * @return $this Fluent Builder */ public function setVettingId(string $vettingId): self { $this->options['vettingId'] = $vettingId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.CreateBrandVettingOptions ' . $options . ']'; } } class ReadBrandVettingOptions extends Options { /** * @param string $vettingProvider The third-party provider of the vettings to read */ public function __construct( string $vettingProvider = Values::NONE ) { $this->options['vettingProvider'] = $vettingProvider; } /** * The third-party provider of the vettings to read * * @param string $vettingProvider The third-party provider of the vettings to read * @return $this Fluent Builder */ public function setVettingProvider(string $vettingProvider): self { $this->options['vettingProvider'] = $vettingProvider; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.ReadBrandVettingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationOptions.php000064400000010614150364341760020224 0ustar00options['brandType'] = $brandType; $this->options['mock'] = $mock; $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; } /** * Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. * * @param string $brandType Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. * @return $this Fluent Builder */ public function setBrandType(string $brandType): self { $this->options['brandType'] = $brandType; return $this; } /** * A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. * * @param bool $mock A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. * @return $this Fluent Builder */ public function setMock(bool $mock): self { $this->options['mock'] = $mock; return $this; } /** * A flag to disable automatic secondary vetting for brands which it would otherwise be done. * * @param bool $skipAutomaticSecVet A flag to disable automatic secondary vetting for brands which it would otherwise be done. * @return $this Fluent Builder */ public function setSkipAutomaticSecVet(bool $skipAutomaticSecVet): self { $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.CreateBrandRegistrationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php000064400000006133150364341760017132 0ustar00solution = [ 'domainSid' => $domainSid, ]; $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) .'/Config'; } /** * Fetch the DomainConfigInstance * * @return DomainConfigInstance Fetched DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigInstance { $payload = $this->version->fetch('GET', $this->uri); return new DomainConfigInstance( $this->version, $payload, $this->solution['domainSid'] ); } /** * Update the DomainConfigInstance * * @param array|Options $options Optional Arguments * @return DomainConfigInstance Updated DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DomainConfigInstance { $options = new Values($options); $data = Values::of([ 'FallbackUrl' => $options['fallbackUrl'], 'CallbackUrl' => $options['callbackUrl'], 'ContinueOnFailure' => Serialize::booleanToString($options['continueOnFailure']), 'DisableHttps' => Serialize::booleanToString($options['disableHttps']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainCertsInstance.php000064400000011511150364341760017121 0ustar00properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'domainName' => Values::array_get($payload, 'domain_name'), 'certificateSid' => Values::array_get($payload, 'certificate_sid'), 'url' => Values::array_get($payload, 'url'), 'certInValidation' => Values::array_get($payload, 'cert_in_validation'), ]; $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DomainCertsContext Context for this DomainCertsInstance */ protected function proxy(): DomainCertsContext { if (!$this->context) { $this->context = new DomainCertsContext( $this->version, $this->solution['domainSid'] ); } return $this->context; } /** * Delete the DomainCertsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DomainCertsInstance * * @return DomainCertsInstance Fetched DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainCertsInstance { return $this->proxy()->fetch(); } /** * Update the DomainCertsInstance * * @param string $tlsCert Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. * @return DomainCertsInstance Updated DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $tlsCert): DomainCertsInstance { return $this->proxy()->update($tlsCert); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainCertsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/UsecaseInstance.php000064400000003760150364341760016310 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceContext.php000064400000021345150364341760016177 0ustar00solution = [ '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'], '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'] ); } /** * Access the alphaSenders */ protected function getAlphaSenders(): AlphaSenderList { if (!$this->_alphaSenders) { $this->_alphaSenders = new AlphaSenderList( $this->version, $this->solution['sid'] ); } return $this->_alphaSenders; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList( $this->version, $this->solution['sid'] ); } return $this->_phoneNumbers; } /** * Access the usAppToPersonUsecases */ protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList { if (!$this->_usAppToPersonUsecases) { $this->_usAppToPersonUsecases = new UsAppToPersonUsecaseList( $this->version, $this->solution['sid'] ); } return $this->_usAppToPersonUsecases; } /** * Access the channelSenders */ protected function getChannelSenders(): ChannelSenderList { if (!$this->_channelSenders) { $this->_channelSenders = new ChannelSenderList( $this->version, $this->solution['sid'] ); } return $this->_channelSenders; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList( $this->version, $this->solution['sid'] ); } return $this->_shortCodes; } /** * Access the usAppToPerson */ protected function getUsAppToPerson(): UsAppToPersonList { if (!$this->_usAppToPerson) { $this->_usAppToPerson = new UsAppToPersonList( $this->version, $this->solution['sid'] ); } return $this->_usAppToPerson; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php000064400000006055150364341760022755 0ustar00solution = [ 'domainSid' => $domainSid, 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) .'/MessagingServices/' . \rawurlencode($messagingServiceSid) .''; } /** * Create the LinkshorteningMessagingServiceInstance * * @return LinkshorteningMessagingServiceInstance Created LinkshorteningMessagingServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): LinkshorteningMessagingServiceInstance { $payload = $this->version->create('POST', $this->uri); return new LinkshorteningMessagingServiceInstance( $this->version, $payload, $this->solution['domainSid'], $this->solution['messagingServiceSid'] ); } /** * Delete the LinkshorteningMessagingServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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.LinkshorteningMessagingServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationList.php000064400000003426150364341760025570 0ustar00solution = [ ]; } /** * Constructs a LinkshorteningMessagingServiceDomainAssociationContext * * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. */ public function getContext( string $messagingServiceSid ): LinkshorteningMessagingServiceDomainAssociationContext { return new LinkshorteningMessagingServiceDomainAssociationContext( $this->version, $messagingServiceSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationList]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainCertsList.php000064400000003032150364341760016267 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php000064400000004665150364341760026307 0ustar00solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/LinkShortening/MessagingServices/' . \rawurlencode($messagingServiceSid) .'/Domain'; } /** * Fetch the LinkshorteningMessagingServiceDomainAssociationInstance * * @return LinkshorteningMessagingServiceDomainAssociationInstance Fetched LinkshorteningMessagingServiceDomainAssociationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): LinkshorteningMessagingServiceDomainAssociationInstance { $payload = $this->version->fetch('GET', $this->uri); return new LinkshorteningMessagingServiceDomainAssociationInstance( $this->version, $payload, $this->solution['messagingServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/UsecaseList.php000064400000003134150364341760015452 0ustar00solution = [ ]; $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]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php000064400000011470150364341760020216 0ustar00solution = [ '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 brandRegistrationOtps */ protected function getBrandRegistrationOtps(): BrandRegistrationOtpList { if (!$this->_brandRegistrationOtps) { $this->_brandRegistrationOtps = new BrandRegistrationOtpList( $this->version, $this->solution['sid'] ); } return $this->_brandRegistrationOtps; } /** * Access the brandVettings */ protected function getBrandVettings(): BrandVettingList { if (!$this->_brandVettings) { $this->_brandVettings = new BrandVettingList( $this->version, $this->solution['sid'] ); } return $this->_brandVettings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.BrandRegistrationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php000064400000010771150364341760020717 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsInstance.php000064400000006050150364341760017510 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigOptions.php000064400000014075150364341760017145 0ustar00options['fallbackUrl'] = $fallbackUrl; $this->options['callbackUrl'] = $callbackUrl; $this->options['continueOnFailure'] = $continueOnFailure; $this->options['disableHttps'] = $disableHttps; } /** * Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. * * @param string $fallbackUrl Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * URL to receive click events to your webhook whenever the recipients click on the shortened links * * @param string $callbackUrl URL to receive click events to your webhook whenever the recipients click on the shortened links * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Boolean field to set customer delivery preference when there is a failure in linkShortening service * * @param bool $continueOnFailure Boolean field to set customer delivery preference when there is a failure in linkShortening service * @return $this Fluent Builder */ public function setContinueOnFailure(bool $continueOnFailure): self { $this->options['continueOnFailure'] = $continueOnFailure; return $this; } /** * Customer's choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. * * @param bool $disableHttps Customer's choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. * @return $this Fluent Builder */ public function setDisableHttps(bool $disableHttps): self { $this->options['disableHttps'] = $disableHttps; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.UpdateDomainConfigOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationList.php000064400000015106150364341760017505 0ustar00solution = [ ]; $this->uri = '/a2p/BrandRegistrations'; } /** * Create the BrandRegistrationInstance * * @param string $customerProfileBundleSid Customer Profile Bundle Sid. * @param string $a2PProfileBundleSid A2P Messaging Profile Bundle Sid. * @param array|Options $options Optional Arguments * @return BrandRegistrationInstance Created BrandRegistrationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $customerProfileBundleSid, string $a2PProfileBundleSid, array $options = []): BrandRegistrationInstance { $options = new Values($options); $data = Values::of([ 'CustomerProfileBundleSid' => $customerProfileBundleSid, 'A2PProfileBundleSid' => $a2PProfileBundleSid, 'BrandType' => $options['brandType'], 'Mock' => Serialize::booleanToString($options['mock']), 'SkipAutomaticSecVet' => Serialize::booleanToString($options['skipAutomaticSecVet']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BrandRegistrationInstance( $this->version, $payload ); } /** * Reads BrandRegistrationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BrandRegistrationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BrandRegistrationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BrandRegistrationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BrandRegistrationPage Page of BrandRegistrationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BrandRegistrationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BrandRegistrationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BrandRegistrationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BrandRegistrationPage Page of BrandRegistrationInstance */ public function getPage(string $targetUrl): BrandRegistrationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BrandRegistrationPage($this->version, $response, $this->solution); } /** * Constructs a BrandRegistrationContext * * @param string $sid The SID of the Brand Registration resource to fetch. */ public function getContext( string $sid ): BrandRegistrationContext { return new BrandRegistrationContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationList]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceList.php000064400000003244150364341760021600 0ustar00solution = [ ]; } /** * Constructs a DomainConfigMessagingServiceContext * * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. */ public function getContext( string $messagingServiceSid ): DomainConfigMessagingServiceContext { return new DomainConfigMessagingServiceContext( $this->version, $messagingServiceSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DomainConfigMessagingServiceList]'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceInstance.php000064400000017447150364341760016327 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'inboundRequestUrl' => Values::array_get($payload, 'inbound_request_url'), 'inboundMethod' => Values::array_get($payload, 'inbound_method'), 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), 'fallbackMethod' => Values::array_get($payload, 'fallback_method'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'stickySender' => Values::array_get($payload, 'sticky_sender'), 'mmsConverter' => Values::array_get($payload, 'mms_converter'), 'smartEncoding' => Values::array_get($payload, 'smart_encoding'), 'scanMessageContent' => Values::array_get($payload, 'scan_message_content'), 'fallbackToLongCode' => Values::array_get($payload, 'fallback_to_long_code'), 'areaCodeGeomatch' => Values::array_get($payload, 'area_code_geomatch'), 'synchronousValidation' => Values::array_get($payload, 'synchronous_validation'), 'validityPeriod' => Values::array_get($payload, 'validity_period'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'usecase' => Values::array_get($payload, 'usecase'), 'usAppToPersonRegistered' => Values::array_get($payload, 'us_app_to_person_registered'), 'useInboundWebhookOnNumber' => Values::array_get($payload, 'use_inbound_webhook_on_number'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the alphaSenders */ protected function getAlphaSenders(): AlphaSenderList { return $this->proxy()->alphaSenders; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { return $this->proxy()->phoneNumbers; } /** * Access the usAppToPersonUsecases */ protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList { return $this->proxy()->usAppToPersonUsecases; } /** * Access the channelSenders */ protected function getChannelSenders(): ChannelSenderList { return $this->proxy()->channelSenders; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { return $this->proxy()->shortCodes; } /** * Access the usAppToPerson */ protected function getUsAppToPerson(): UsAppToPersonList { return $this->proxy()->usAppToPerson; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigList.php000064400000003033150364341760016415 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/VideoBase.php000064400000004513150364341760012666 0ustar00baseUrl = 'https://video.twilio.com'; } /** * @return V1 Version v1 of video */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video]'; } } sdk/src/Twilio/Rest/Routes.php000064400000003743150364341760012312 0ustar00phoneNumbers instead. */ protected function getPhoneNumbers(): \Twilio\Rest\Routes\V2\PhoneNumberList { echo "phoneNumbers is deprecated. Use v2->phoneNumbers instead."; return $this->v2->phoneNumbers; } /** * @deprecated Use v2->phoneNumbers(\$phoneNumber) instead. * @param string $phoneNumber The phone number */ protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Routes\V2\PhoneNumberContext { echo "phoneNumbers(\$phoneNumber) is deprecated. Use v2->phoneNumbers(\$phoneNumber) instead."; return $this->v2->phoneNumbers($phoneNumber); } /** * @deprecated Use v2->sipDomains instead. */ protected function getSipDomains(): \Twilio\Rest\Routes\V2\SipDomainList { echo "sipDomains is deprecated. Use v2->sipDomains instead."; return $this->v2->sipDomains; } /** * @deprecated Use v2->sipDomains(\$sipDomain) instead. * @param string $sipDomain The sip_domain */ protected function contextSipDomains(string $sipDomain): \Twilio\Rest\Routes\V2\SipDomainContext { echo "sipDomains(\$sipDomain) is deprecated. Use v2->sipDomains(\$sipDomain) instead."; return $this->v2->sipDomains($sipDomain); } /** * @deprecated Use v2->trunks instead. */ protected function getTrunks(): \Twilio\Rest\Routes\V2\TrunkList { echo "trunks is deprecated. Use v2->trunks instead."; return $this->v2->trunks; } /** * @deprecated Use v2->trunks(\$sipTrunkDomain instead. * @param string $sipTrunkDomain The SIP Trunk */ protected function contextTrunks(string $sipTrunkDomain): \Twilio\Rest\Routes\V2\TrunkContext { echo "trunks(\$sipTrunkDomain) is deprecated. Use v2->trunks(\$sipTrunkDomain instead."; return $this->v2->trunks($sipTrunkDomain); } }sdk/src/Twilio/Rest/BulkexportsBase.php000064400000004565150364341760014151 0ustar00baseUrl = 'https://bulkexports.twilio.com'; } /** * @return V1 Version v1 of bulkexports */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports]'; } } sdk/src/Twilio/Rest/TrusthubBase.php000064400000004540150364341760013440 0ustar00baseUrl = 'https://trusthub.twilio.com'; } /** * @return V1 Version v1 of trusthub */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub]'; } } sdk/src/Twilio/Rest/TrunkingBase.php000064400000004540150364341760013421 0ustar00baseUrl = 'https://trunking.twilio.com'; } /** * @return V1 Version v1 of trunking */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking]'; } } sdk/src/Twilio/Rest/Serverless.php000064400000001313150364341760013155 0ustar00services instead. */ protected function getServices(): \Twilio\Rest\Serverless\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Serverless\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } }sdk/src/Twilio/Rest/ContentBase.php000064400000004531150364341760013232 0ustar00baseUrl = '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); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content]'; } } sdk/src/Twilio/Rest/Studio.php000064400000001646150364341760012300 0ustar00flows instead. */ protected function getFlows(): \Twilio\Rest\Studio\V2\FlowList { echo "flows is deprecated. Use v2->flows instead."; return $this->v2->flows; } /** * @deprecated Use v2->flows(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextFlows(string $sid): \Twilio\Rest\Studio\V2\FlowContext { echo "flows(\$sid) is deprecated. Use v2->flows(\$sid) instead."; return $this->v2->flows($sid); } /** * @deprecated Use v2->flowValidate instead. */ protected function getFlowValidate(): \Twilio\Rest\Studio\V2\FlowValidateList { echo "flowValidate is deprecated. Use v2->flowValidate instead."; return $this->v2->flowValidate; } }sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptPage.php000064400000003122150364341760017331 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return VerificationAttemptInstance \Twilio\Rest\Verify\V2\VerificationAttemptInstance */ public function buildInstance(array $payload): VerificationAttemptInstance { return new VerificationAttemptInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationAttemptPage]'; } } sdk/src/Twilio/Rest/Verify/V2/SafelistInstance.php000064400000007165150364341760016025 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SafelistContext Context for this SafelistInstance */ protected function proxy(): SafelistContext { if (!$this->context) { $this->context = new SafelistContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Delete the SafelistInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SafelistInstance * * @return SafelistInstance Fetched SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SafelistInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.SafelistInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php000064400000005201150364341760021642 0ustar00solution = [ ]; $this->uri = '/Attempts/Summary'; } /** * Fetch the VerificationAttemptsSummaryInstance * * @param array|Options $options Optional Arguments * @return VerificationAttemptsSummaryInstance Fetched VerificationAttemptsSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): VerificationAttemptsSummaryInstance { $options = new Values($options); $params = Values::of([ 'VerifyServiceSid' => $options['verifyServiceSid'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'Country' => $options['country'], 'Channel' => $options['channel'], 'DestinationPrefix' => $options['destinationPrefix'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new VerificationAttemptsSummaryInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationAttemptsSummaryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationList.php000064400000005623150364341760022603 0ustar00solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, 'challengeSid' => $challengeSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Challenges/' . \rawurlencode($challengeSid) .'/Notifications'; } /** * Create the NotificationInstance * * @param array|Options $options Optional Arguments * @return NotificationInstance Created NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): NotificationInstance { $options = new Values($options); $data = Values::of([ 'Ttl' => $options['ttl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NotificationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['challengeSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NotificationList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationInstance.php000064400000006745150364341760023442 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'challengeSid' => Values::array_get($payload, 'challenge_sid'), 'priority' => Values::array_get($payload, 'priority'), 'ttl' => Values::array_get($payload, 'ttl'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'challengeSid' => $challengeSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NotificationInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationPage.php000064400000003267150364341760022546 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return NotificationInstance \Twilio\Rest\Verify\V2\Service\Entity\Challenge\NotificationInstance */ public function buildInstance(array $payload): NotificationInstance { return new NotificationInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['challengeSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NotificationPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationOptions.php000064400000005464150364341760023326 0ustar00options['ttl'] = $ttl; } /** * How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. * * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorPage.php000064400000003160150364341760020116 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return NewFactorInstance \Twilio\Rest\Verify\V2\Service\Entity\NewFactorInstance */ public function buildInstance(array $payload): NewFactorInstance { return new NewFactorInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NewFactorPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorOptions.php000064400000035513150364341760020704 0ustar00options['bindingAlg'] = $bindingAlg; $this->options['bindingPublicKey'] = $bindingPublicKey; $this->options['configAppId'] = $configAppId; $this->options['configNotificationPlatform'] = $configNotificationPlatform; $this->options['configNotificationToken'] = $configNotificationToken; $this->options['configSdkVersion'] = $configSdkVersion; $this->options['bindingSecret'] = $bindingSecret; $this->options['configTimeStep'] = $configTimeStep; $this->options['configSkew'] = $configSkew; $this->options['configCodeLength'] = $configCodeLength; $this->options['configAlg'] = $configAlg; $this->options['metadata'] = $metadata; } /** * The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` * * @param string $bindingAlg The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` * @return $this Fluent Builder */ public function setBindingAlg(string $bindingAlg): self { $this->options['bindingAlg'] = $bindingAlg; return $this; } /** * The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` * * @param string $bindingPublicKey The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` * @return $this Fluent Builder */ public function setBindingPublicKey(string $bindingPublicKey): self { $this->options['bindingPublicKey'] = $bindingPublicKey; return $this; } /** * The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. * * @param string $configAppId The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. * @return $this Fluent Builder */ public function setConfigAppId(string $configAppId): self { $this->options['configAppId'] = $configAppId; return $this; } /** * @param string $configNotificationPlatform * @return $this Fluent Builder */ public function setConfigNotificationPlatform(string $configNotificationPlatform): self { $this->options['configNotificationPlatform'] = $configNotificationPlatform; return $this; } /** * For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. * * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. * @return $this Fluent Builder */ public function setConfigNotificationToken(string $configNotificationToken): self { $this->options['configNotificationToken'] = $configNotificationToken; return $this; } /** * The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` * * @param string $configSdkVersion The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` * @return $this Fluent Builder */ public function setConfigSdkVersion(string $configSdkVersion): self { $this->options['configSdkVersion'] = $configSdkVersion; return $this; } /** * The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` * * @param string $bindingSecret The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` * @return $this Fluent Builder */ public function setBindingSecret(string $bindingSecret): self { $this->options['bindingSecret'] = $bindingSecret; return $this; } /** * Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` * * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` * @return $this Fluent Builder */ public function setConfigTimeStep(int $configTimeStep): self { $this->options['configTimeStep'] = $configTimeStep; return $this; } /** * The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` * * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` * @return $this Fluent Builder */ public function setConfigSkew(int $configSkew): self { $this->options['configSkew'] = $configSkew; return $this; } /** * Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` * * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` * @return $this Fluent Builder */ public function setConfigCodeLength(int $configCodeLength): self { $this->options['configCodeLength'] = $configCodeLength; return $this; } /** * @param string $configAlg * @return $this Fluent Builder */ public function setConfigAlg(string $configAlg): self { $this->options['configAlg'] = $configAlg; return $this; } /** * Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * * @param array $metadata Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * @return $this Fluent Builder */ public function setMetadata(array $metadata): self { $this->options['metadata'] = $metadata; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateNewFactorOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php000064400000010506150364341760020216 0ustar00solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Factors/' . \rawurlencode($sid) .''; } /** * Delete the FactorInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the FactorInstance * * @return FactorInstance Fetched FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FactorInstance { $payload = $this->version->fetch('GET', $this->uri); return new FactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Update the FactorInstance * * @param array|Options $options Optional Arguments * @return FactorInstance Updated FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FactorInstance { $options = new Values($options); $data = Values::of([ 'AuthPayload' => $options['authPayload'], 'FriendlyName' => $options['friendlyName'], 'Config.NotificationToken' => $options['configNotificationToken'], 'Config.SdkVersion' => $options['configSdkVersion'], 'Config.TimeStep' => $options['configTimeStep'], 'Config.Skew' => $options['configSkew'], 'Config.CodeLength' => $options['configCodeLength'], 'Config.Alg' => $options['configAlg'], 'Config.NotificationPlatform' => $options['configNotificationPlatform'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.FactorContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorPage.php000064400000003136150364341760017447 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return FactorInstance \Twilio\Rest\Verify\V2\Service\Entity\FactorInstance */ public function buildInstance(array $payload): FactorInstance { return new FactorInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.FactorPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorInstance.php000064400000013003150364341760020331 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'factorType' => Values::array_get($payload, 'factor_type'), 'config' => Values::array_get($payload, 'config'), 'metadata' => Values::array_get($payload, 'metadata'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FactorContext Context for this FactorInstance */ protected function proxy(): FactorContext { if (!$this->context) { $this->context = new FactorContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->context; } /** * Delete the FactorInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FactorInstance * * @return FactorInstance Fetched FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FactorInstance { return $this->proxy()->fetch(); } /** * Update the FactorInstance * * @param array|Options $options Optional Arguments * @return FactorInstance Updated FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FactorInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.FactorInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php000064400000012436150364341760020666 0ustar00solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Challenges/' . \rawurlencode($sid) .''; } /** * Fetch the ChallengeInstance * * @return ChallengeInstance Fetched ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChallengeInstance { $payload = $this->version->fetch('GET', $this->uri); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Update the ChallengeInstance * * @param array|Options $options Optional Arguments * @return ChallengeInstance Updated ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChallengeInstance { $options = new Values($options); $data = Values::of([ 'AuthPayload' => $options['authPayload'], 'Metadata' => Serialize::jsonObject($options['metadata']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->_notifications; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ChallengeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorList.php000064400000010067150364341760020161 0ustar00solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Factors'; } /** * Create the NewFactorInstance * * @param string $friendlyName The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For `factor_type` `push`, this could be a device name. For `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property. At the same time, we recommend avoiding providing PII. * @param string $factorType * @param array|Options $options Optional Arguments * @return NewFactorInstance Created NewFactorInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $factorType, array $options = []): NewFactorInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'FactorType' => $factorType, 'Binding.Alg' => $options['bindingAlg'], 'Binding.PublicKey' => $options['bindingPublicKey'], 'Config.AppId' => $options['configAppId'], 'Config.NotificationPlatform' => $options['configNotificationPlatform'], 'Config.NotificationToken' => $options['configNotificationToken'], 'Config.SdkVersion' => $options['configSdkVersion'], 'Binding.Secret' => $options['bindingSecret'], 'Config.TimeStep' => $options['configTimeStep'], 'Config.Skew' => $options['configSkew'], 'Config.CodeLength' => $options['configCodeLength'], 'Config.Alg' => $options['configAlg'], 'Metadata' => Serialize::jsonObject($options['metadata']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NewFactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NewFactorList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeInstance.php000064400000014236150364341760021006 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'factorSid' => Values::array_get($payload, 'factor_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateResponded' => Deserialize::dateTime(Values::array_get($payload, 'date_responded')), 'expirationDate' => Deserialize::dateTime(Values::array_get($payload, 'expiration_date')), 'status' => Values::array_get($payload, 'status'), 'respondedReason' => Values::array_get($payload, 'responded_reason'), 'details' => Values::array_get($payload, 'details'), 'hiddenDetails' => Values::array_get($payload, 'hidden_details'), 'metadata' => Values::array_get($payload, 'metadata'), 'factorType' => Values::array_get($payload, 'factor_type'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChallengeContext Context for this ChallengeInstance */ protected function proxy(): ChallengeContext { if (!$this->context) { $this->context = new ChallengeContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ChallengeInstance * * @return ChallengeInstance Fetched ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChallengeInstance { return $this->proxy()->fetch(); } /** * Update the ChallengeInstance * * @param array|Options $options Optional Arguments * @return ChallengeInstance Updated ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChallengeInstance { return $this->proxy()->update($options); } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ChallengeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorOptions.php000064400000023146150364341760020231 0ustar00options['authPayload'] = $authPayload; $this->options['friendlyName'] = $friendlyName; $this->options['configNotificationToken'] = $configNotificationToken; $this->options['configSdkVersion'] = $configSdkVersion; $this->options['configTimeStep'] = $configTimeStep; $this->options['configSkew'] = $configSkew; $this->options['configCodeLength'] = $configCodeLength; $this->options['configAlg'] = $configAlg; $this->options['configNotificationPlatform'] = $configNotificationPlatform; } /** * The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. * * @param string $authPayload The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. * @return $this Fluent Builder */ public function setAuthPayload(string $authPayload): self { $this->options['authPayload'] = $authPayload; return $this; } /** * The new friendly name of this Factor. It can be up to 64 characters. * * @param string $friendlyName The new friendly name of this Factor. It can be up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. * * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. * @return $this Fluent Builder */ public function setConfigNotificationToken(string $configNotificationToken): self { $this->options['configNotificationToken'] = $configNotificationToken; return $this; } /** * The Verify Push SDK version used to configure the factor * * @param string $configSdkVersion The Verify Push SDK version used to configure the factor * @return $this Fluent Builder */ public function setConfigSdkVersion(string $configSdkVersion): self { $this->options['configSdkVersion'] = $configSdkVersion; return $this; } /** * Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive * * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive * @return $this Fluent Builder */ public function setConfigTimeStep(int $configTimeStep): self { $this->options['configTimeStep'] = $configTimeStep; return $this; } /** * The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive * * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive * @return $this Fluent Builder */ public function setConfigSkew(int $configSkew): self { $this->options['configSkew'] = $configSkew; return $this; } /** * Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive * * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive * @return $this Fluent Builder */ public function setConfigCodeLength(int $configCodeLength): self { $this->options['configCodeLength'] = $configCodeLength; return $this; } /** * @param string $configAlg * @return $this Fluent Builder */ public function setConfigAlg(string $configAlg): self { $this->options['configAlg'] = $configAlg; return $this; } /** * The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. * * @param string $configNotificationPlatform The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. * @return $this Fluent Builder */ public function setConfigNotificationPlatform(string $configNotificationPlatform): self { $this->options['configNotificationPlatform'] = $configNotificationPlatform; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateFactorOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeOptions.php000064400000034675150364341760020706 0ustar00options['expirationDate'] = $expirationDate; $this->options['detailsMessage'] = $detailsMessage; $this->options['detailsFields'] = $detailsFields; $this->options['hiddenDetails'] = $hiddenDetails; $this->options['authPayload'] = $authPayload; } /** * The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. * * @param \DateTime $expirationDate The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. * @return $this Fluent Builder */ public function setExpirationDate(\DateTime $expirationDate): self { $this->options['expirationDate'] = $expirationDate; return $this; } /** * Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length * * @param string $detailsMessage Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length * @return $this Fluent Builder */ public function setDetailsMessage(string $detailsMessage): self { $this->options['detailsMessage'] = $detailsMessage; return $this; } /** * A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. * * @param array[] $detailsFields A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. * @return $this Fluent Builder */ public function setDetailsFields(array $detailsFields): self { $this->options['detailsFields'] = $detailsFields; return $this; } /** * Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length * * @param array $hiddenDetails Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length * @return $this Fluent Builder */ public function setHiddenDetails(array $hiddenDetails): self { $this->options['hiddenDetails'] = $hiddenDetails; return $this; } /** * Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. * * @param string $authPayload Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. * @return $this Fluent Builder */ public function setAuthPayload(string $authPayload): self { $this->options['authPayload'] = $authPayload; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateChallengeOptions ' . $options . ']'; } } class ReadChallengeOptions extends Options { /** * @param string $factorSid The unique SID identifier of the Factor. * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. */ public function __construct( string $factorSid = Values::NONE, string $status = Values::NONE, string $order = Values::NONE ) { $this->options['factorSid'] = $factorSid; $this->options['status'] = $status; $this->options['order'] = $order; } /** * The unique SID identifier of the Factor. * * @param string $factorSid The unique SID identifier of the Factor. * @return $this Fluent Builder */ public function setFactorSid(string $factorSid): self { $this->options['factorSid'] = $factorSid; return $this; } /** * The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. * * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. * * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.ReadChallengeOptions ' . $options . ']'; } } class UpdateChallengeOptions extends Options { /** * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. */ public function __construct( string $authPayload = Values::NONE, array $metadata = Values::ARRAY_NONE ) { $this->options['authPayload'] = $authPayload; $this->options['metadata'] = $metadata; } /** * The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length * * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length * @return $this Fluent Builder */ public function setAuthPayload(string $authPayload): self { $this->options['authPayload'] = $authPayload; return $this; } /** * Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * @return $this Fluent Builder */ public function setMetadata(array $metadata): self { $this->options['metadata'] = $metadata; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateChallengeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengePage.php000064400000003160150364341760020110 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return ChallengeInstance \Twilio\Rest\Verify\V2\Service\Entity\ChallengeInstance */ public function buildInstance(array $payload): ChallengeInstance { return new ChallengeInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.ChallengePage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorInstance.php000064400000007531150364341760021014 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'binding' => Values::array_get($payload, 'binding'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'factorType' => Values::array_get($payload, 'factor_type'), 'config' => Values::array_get($payload, 'config'), 'metadata' => Values::array_get($payload, 'metadata'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NewFactorInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeList.php000064400000017163150364341760020157 0ustar00solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Challenges'; } /** * Create the ChallengeInstance * * @param string $factorSid The unique SID identifier of the Factor. * @param array|Options $options Optional Arguments * @return ChallengeInstance Created ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $factorSid, array $options = []): ChallengeInstance { $options = new Values($options); $data = Values::of([ 'FactorSid' => $factorSid, 'ExpirationDate' => Serialize::iso8601DateTime($options['expirationDate']), 'Details.Message' => $options['detailsMessage'], 'Details.Fields' => Serialize::map($options['detailsFields'], function ($e) { return Serialize::jsonObject($e); }), 'HiddenDetails' => Serialize::jsonObject($options['hiddenDetails']), 'AuthPayload' => $options['authPayload'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Reads ChallengeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChallengeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChallengeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChallengeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChallengePage Page of ChallengeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChallengePage { $options = new Values($options); $params = Values::of([ 'FactorSid' => $options['factorSid'], 'Status' => $options['status'], 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChallengePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChallengeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChallengePage Page of ChallengeInstance */ public function getPage(string $targetUrl): ChallengePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChallengePage($this->version, $response, $this->solution); } /** * Constructs a ChallengeContext * * @param string $sid A 34 character string that uniquely identifies this Challenge. */ public function getContext( string $sid ): ChallengeContext { return new ChallengeContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.ChallengeList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorList.php000064400000013446150364341760017513 0ustar00solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Factors'; } /** * Reads FactorInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FactorInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FactorInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FactorInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FactorPage Page of FactorInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FactorPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FactorPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FactorInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FactorPage Page of FactorInstance */ public function getPage(string $targetUrl): FactorPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FactorPage($this->version, $response, $this->solution); } /** * Constructs a FactorContext * * @param string $sid A 34 character string that uniquely identifies this Factor. */ public function getContext( string $sid ): FactorContext { return new FactorContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.FactorList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php000064400000012255150364341760022314 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'country' => Values::array_get($payload, 'country'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'country' => $country ?: $this->properties['country'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessagingConfigurationContext Context for this MessagingConfigurationInstance */ protected function proxy(): MessagingConfigurationContext { if (!$this->context) { $this->context = new MessagingConfigurationContext( $this->version, $this->solution['serviceSid'], $this->solution['country'] ); } return $this->context; } /** * Delete the MessagingConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MessagingConfigurationInstance * * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessagingConfigurationInstance { return $this->proxy()->fetch(); } /** * Update the MessagingConfigurationInstance * * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $messagingServiceSid): MessagingConfigurationInstance { return $this->proxy()->update($messagingServiceSid); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.MessagingConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookList.php000064400000015467150364341760016424 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * @param string $webhookUrl The URL associated with this Webhook. * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $eventTypes, string $webhookUrl, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'EventTypes' => Serialize::map($eventTypes,function ($e) { return $e; }), 'WebhookUrl' => $webhookUrl, 'Status' => $options['status'], 'Version' => $options['version'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid The Twilio-provided string that uniquely identifies the Webhook resource to delete. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.WebhookList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookOptions.php000064400000014170150364341760017132 0ustar00options['status'] = $status; $this->options['version'] = $version; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * @param string $version * @return $this Fluent Builder */ public function setVersion(string $version): self { $this->options['version'] = $version; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * @param string $webhookUrl The URL associated with this Webhook. * @param string $status * @param string $version */ public function __construct( string $friendlyName = Values::NONE, array $eventTypes = Values::ARRAY_NONE, string $webhookUrl = Values::NONE, string $status = Values::NONE, string $version = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['eventTypes'] = $eventTypes; $this->options['webhookUrl'] = $webhookUrl; $this->options['status'] = $status; $this->options['version'] = $version; } /** * The string that you assigned to describe the webhook. **This value should not contain PII.** * * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * @return $this Fluent Builder */ public function setEventTypes(array $eventTypes): self { $this->options['eventTypes'] = $eventTypes; return $this; } /** * The URL associated with this Webhook. * * @param string $webhookUrl The URL associated with this Webhook. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * @param string $version * @return $this Fluent Builder */ public function setVersion(string $version): self { $this->options['version'] = $version; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php000064400000011752150364341760020757 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'rateLimitSid' => Values::array_get($payload, 'rate_limit_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'max' => Values::array_get($payload, 'max'), 'interval' => Values::array_get($payload, 'interval'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BucketContext Context for this BucketInstance */ protected function proxy(): BucketContext { if (!$this->context) { $this->context = new BucketContext( $this->version, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BucketInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BucketInstance * * @return BucketInstance Fetched BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BucketInstance { return $this->proxy()->fetch(); } /** * Update the BucketInstance * * @param array|Options $options Optional Arguments * @return BucketInstance Updated BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): BucketInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.BucketInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php000064400000003150150364341760020060 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return BucketInstance \Twilio\Rest\Verify\V2\Service\RateLimit\BucketInstance */ public function buildInstance(array $payload): BucketInstance { return new BucketInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.BucketPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php000064400000005036150364341760020644 0ustar00options['max'] = $max; $this->options['interval'] = $interval; } /** * Maximum number of requests permitted in during the interval. * * @param int $max Maximum number of requests permitted in during the interval. * @return $this Fluent Builder */ public function setMax(int $max): self { $this->options['max'] = $max; return $this; } /** * Number of seconds that the rate limit will be enforced over. * * @param int $interval Number of seconds that the rate limit will be enforced over. * @return $this Fluent Builder */ public function setInterval(int $interval): self { $this->options['interval'] = $interval; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateBucketOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php000064400000007203150364341760020633 0ustar00solution = [ 'serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/RateLimits/' . \rawurlencode($rateLimitSid) .'/Buckets/' . \rawurlencode($sid) .''; } /** * Delete the BucketInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the BucketInstance * * @return BucketInstance Fetched BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BucketInstance { $payload = $this->version->fetch('GET', $this->uri); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } /** * Update the BucketInstance * * @param array|Options $options Optional Arguments * @return BucketInstance Updated BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): BucketInstance { $options = new Values($options); $data = Values::of([ 'Max' => $options['max'], 'Interval' => $options['interval'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.BucketContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php000064400000015014150364341760020121 0ustar00solution = [ 'serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/RateLimits/' . \rawurlencode($rateLimitSid) .'/Buckets'; } /** * Create the BucketInstance * * @param int $max Maximum number of requests permitted in during the interval. * @param int $interval Number of seconds that the rate limit will be enforced over. * @return BucketInstance Created BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function create(int $max, int $interval): BucketInstance { $data = Values::of([ 'Max' => $max, 'Interval' => $interval, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'] ); } /** * Reads BucketInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BucketInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BucketInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BucketInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BucketPage Page of BucketInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BucketPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BucketPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BucketInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BucketPage Page of BucketInstance */ public function getPage(string $targetUrl): BucketPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BucketPage($this->version, $response, $this->solution); } /** * Constructs a BucketContext * * @param string $sid A 34 character string that uniquely identifies this Bucket. */ public function getContext( string $sid ): BucketContext { return new BucketContext( $this->version, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.BucketList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php000064400000004771150364341760020402 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/VerificationCheck'; } /** * Create the VerificationCheckInstance * * @param array|Options $options Optional Arguments * @return VerificationCheckInstance Created VerificationCheckInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): VerificationCheckInstance { $options = new Values($options); $data = Values::of([ 'Code' => $options['code'], 'To' => $options['to'], 'VerificationSid' => $options['verificationSid'], 'Amount' => $options['amount'], 'Payee' => $options['payee'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new VerificationCheckInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationCheckList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenPage.php000064400000003121150364341760017151 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return AccessTokenInstance \Twilio\Rest\Verify\V2\Service\AccessTokenInstance */ public function buildInstance(array $payload): AccessTokenInstance { return new AccessTokenInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.AccessTokenPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenList.php000064400000005753150364341760017225 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/AccessTokens'; } /** * Create the AccessTokenInstance * * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID. * @param string $factorType * @param array|Options $options Optional Arguments * @return AccessTokenInstance Created AccessTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, string $factorType, array $options = []): AccessTokenInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'FactorType' => $factorType, 'FactorFriendlyName' => $options['factorFriendlyName'], 'Ttl' => $options['ttl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AccessTokenInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Constructs a AccessTokenContext * * @param string $sid A 34 character string that uniquely identifies this Access Token. */ public function getContext( string $sid ): AccessTokenContext { return new AccessTokenContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.AccessTokenList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/EntityContext.php000064400000012740150364341760017002 0ustar00solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .''; } /** * Delete the EntityInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the EntityInstance * * @return EntityInstance Fetched EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EntityInstance { $payload = $this->version->fetch('GET', $this->uri); return new EntityInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Access the factors */ protected function getFactors(): FactorList { if (!$this->_factors) { $this->_factors = new FactorList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_factors; } /** * Access the newFactors */ protected function getNewFactors(): NewFactorList { if (!$this->_newFactors) { $this->_newFactors = new NewFactorList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_newFactors; } /** * Access the challenges */ protected function getChallenges(): ChallengeList { if (!$this->_challenges) { $this->_challenges = new ChallengeList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_challenges; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.EntityContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php000064400000004351150364341760017727 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/AccessTokens/' . \rawurlencode($sid) .''; } /** * Fetch the AccessTokenInstance * * @return AccessTokenInstance Fetched AccessTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccessTokenInstance { $payload = $this->version->fetch('GET', $this->uri); return new AccessTokenInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.AccessTokenContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php000064400000016014150364341760021460 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/MessagingConfigurations'; } /** * Create the MessagingConfigurationInstance * * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. * @return MessagingConfigurationInstance Created MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $country, string $messagingServiceSid): MessagingConfigurationInstance { $data = Values::of([ 'Country' => $country, 'MessagingServiceSid' => $messagingServiceSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessagingConfigurationInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads MessagingConfigurationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessagingConfigurationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams MessagingConfigurationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessagingConfigurationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagingConfigurationPage Page of MessagingConfigurationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagingConfigurationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagingConfigurationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessagingConfigurationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagingConfigurationPage Page of MessagingConfigurationInstance */ public function getPage(string $targetUrl): MessagingConfigurationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagingConfigurationPage($this->version, $response, $this->solution); } /** * Constructs a MessagingConfigurationContext * * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. */ public function getContext( string $country ): MessagingConfigurationContext { return new MessagingConfigurationContext( $this->version, $this->solution['serviceSid'], $country ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.MessagingConfigurationList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php000064400000007053150364341760017125 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'EventTypes' => Serialize::map($options['eventTypes'], function ($e) { return $e; }), 'WebhookUrl' => $options['webhookUrl'], 'Status' => $options['status'], 'Version' => $options['version'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationInstance.php000064400000012177150364341760020274 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'channel' => Values::array_get($payload, 'channel'), 'status' => Values::array_get($payload, 'status'), 'valid' => Values::array_get($payload, 'valid'), 'lookup' => Values::array_get($payload, 'lookup'), 'amount' => Values::array_get($payload, 'amount'), 'payee' => Values::array_get($payload, 'payee'), 'sendCodeAttempts' => Values::array_get($payload, 'send_code_attempts'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sna' => Values::array_get($payload, 'sna'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return VerificationContext Context for this VerificationInstance */ protected function proxy(): VerificationContext { if (!$this->context) { $this->context = new VerificationContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the VerificationInstance * * @return VerificationInstance Fetched VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VerificationInstance { return $this->proxy()->fetch(); } /** * Update the VerificationInstance * * @param string $status * @return VerificationInstance Updated VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): VerificationInstance { return $this->proxy()->update($status); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php000064400000003165150364341760020337 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return VerificationCheckInstance \Twilio\Rest\Verify\V2\Service\VerificationCheckInstance */ public function buildInstance(array $payload): VerificationCheckInstance { return new VerificationCheckInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationCheckPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/EntityPage.php000064400000003063150364341760016230 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return EntityInstance \Twilio\Rest\Verify\V2\Service\EntityInstance */ public function buildInstance(array $payload): EntityInstance { return new EntityInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.EntityPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenOptions.php000064400000005652150364341760017743 0ustar00options['factorFriendlyName'] = $factorFriendlyName; $this->options['ttl'] = $ttl; } /** * The friendly name of the factor that is going to be created with this access token * * @param string $factorFriendlyName The friendly name of the factor that is going to be created with this access token * @return $this Fluent Builder */ public function setFactorFriendlyName(string $factorFriendlyName): self { $this->options['factorFriendlyName'] = $factorFriendlyName; return $this; } /** * How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. * * @param int $ttl How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateAccessTokenOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookInstance.php000064400000012076150364341760017246 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'eventTypes' => Values::array_get($payload, 'event_types'), 'status' => Values::array_get($payload, 'status'), 'version' => Values::array_get($payload, 'version'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php000064400000007372150364341760022200 0ustar00solution = [ 'serviceSid' => $serviceSid, 'country' => $country, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/MessagingConfigurations/' . \rawurlencode($country) .''; } /** * Delete the MessagingConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MessagingConfigurationInstance * * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessagingConfigurationInstance { $payload = $this->version->fetch('GET', $this->uri); return new MessagingConfigurationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['country'] ); } /** * Update the MessagingConfigurationInstance * * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $messagingServiceSid): MessagingConfigurationInstance { $data = Values::of([ 'MessagingServiceSid' => $messagingServiceSid, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MessagingConfigurationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['country'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.MessagingConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitList.php000064400000014731150364341760016711 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/RateLimits'; } /** * Create the RateLimitInstance * * @param string $uniqueName Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.** * @param array|Options $options Optional Arguments * @return RateLimitInstance Created RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): RateLimitInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'Description' => $options['description'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RateLimitInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RateLimitInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RateLimitInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RateLimitInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RateLimitInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RateLimitPage Page of RateLimitInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RateLimitPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RateLimitPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RateLimitInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RateLimitPage Page of RateLimitInstance */ public function getPage(string $targetUrl): RateLimitPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RateLimitPage($this->version, $response, $this->solution); } /** * Constructs a RateLimitContext * * @param string $sid The Twilio-provided string that uniquely identifies the Rate Limit resource to fetch. */ public function getContext( string $sid ): RateLimitContext { return new RateLimitContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.RateLimitList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationPage.php000064400000003127150364341760017377 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return VerificationInstance \Twilio\Rest\Verify\V2\Service\VerificationInstance */ public function buildInstance(array $payload): VerificationInstance { return new VerificationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php000064400000003223150364341760021417 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return MessagingConfigurationInstance \Twilio\Rest\Verify\V2\Service\MessagingConfigurationInstance */ public function buildInstance(array $payload): MessagingConfigurationInstance { return new MessagingConfigurationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.MessagingConfigurationPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitPage.php000064400000003105150364341760016643 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return RateLimitInstance \Twilio\Rest\Verify\V2\Service\RateLimitInstance */ public function buildInstance(array $payload): RateLimitInstance { return new RateLimitInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.RateLimitPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/EntityList.php000064400000014667150364341760016303 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities'; } /** * Create the EntityInstance * * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. * @return EntityInstance Created EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity): EntityInstance { $data = Values::of([ 'Identity' => $identity, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EntityInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads EntityInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EntityInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EntityInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EntityInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EntityPage Page of EntityInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EntityPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EntityPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EntityInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EntityPage Page of EntityInstance */ public function getPage(string $targetUrl): EntityPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EntityPage($this->version, $response, $this->solution); } /** * Constructs a EntityContext * * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ public function getContext( string $identity ): EntityContext { return new EntityContext( $this->version, $this->solution['serviceSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.EntityList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php000064400000012000150364341760017405 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/RateLimits/' . \rawurlencode($sid) .''; } /** * Delete the RateLimitInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RateLimitInstance * * @return RateLimitInstance Fetched RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RateLimitInstance { $payload = $this->version->fetch('GET', $this->uri); return new RateLimitInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the RateLimitInstance * * @param array|Options $options Optional Arguments * @return RateLimitInstance Updated RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RateLimitInstance { $options = new Values($options); $data = Values::of([ 'Description' => $options['description'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RateLimitInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the buckets */ protected function getBuckets(): BucketList { if (!$this->_buckets) { $this->_buckets = new BucketList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_buckets; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.RateLimitContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/EntityInstance.php000064400000012252150364341760017120 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EntityContext Context for this EntityInstance */ protected function proxy(): EntityContext { if (!$this->context) { $this->context = new EntityContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the EntityInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EntityInstance * * @return EntityInstance Fetched EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EntityInstance { return $this->proxy()->fetch(); } /** * Access the factors */ protected function getFactors(): FactorList { return $this->proxy()->factors; } /** * Access the newFactors */ protected function getNewFactors(): NewFactorList { return $this->proxy()->newFactors; } /** * Access the challenges */ protected function getChallenges(): ChallengeList { return $this->proxy()->challenges; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.EntityInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenInstance.php000064400000010355150364341760020050 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entityIdentity' => Values::array_get($payload, 'entity_identity'), 'factorType' => Values::array_get($payload, 'factor_type'), 'factorFriendlyName' => Values::array_get($payload, 'factor_friendly_name'), 'token' => Values::array_get($payload, 'token'), 'url' => Values::array_get($payload, 'url'), 'ttl' => Values::array_get($payload, 'ttl'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AccessTokenContext Context for this AccessTokenInstance */ protected function proxy(): AccessTokenContext { if (!$this->context) { $this->context = new AccessTokenContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the AccessTokenInstance * * @return AccessTokenInstance Fetched AccessTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccessTokenInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.AccessTokenInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.php000064400000042216150364341760020160 0ustar00 Your AppName verification code is: 1234 He42w354ol9`. * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. * @param string $riskCheck * @return CreateVerificationOptions Options builder */ public static function create( string $customFriendlyName = Values::NONE, string $customMessage = Values::NONE, string $sendDigits = Values::NONE, string $locale = Values::NONE, string $customCode = Values::NONE, string $amount = Values::NONE, string $payee = Values::NONE, array $rateLimits = Values::ARRAY_NONE, array $channelConfiguration = Values::ARRAY_NONE, string $appHash = Values::NONE, string $templateSid = Values::NONE, string $templateCustomSubstitutions = Values::NONE, string $deviceIp = Values::NONE, string $riskCheck = Values::NONE ): CreateVerificationOptions { return new CreateVerificationOptions( $customFriendlyName, $customMessage, $sendDigits, $locale, $customCode, $amount, $payee, $rateLimits, $channelConfiguration, $appHash, $templateSid, $templateCustomSubstitutions, $deviceIp, $riskCheck ); } } class CreateVerificationOptions extends Options { /** * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message * @param string $customMessage The text of a custom message to use for the verification. * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. * @param string $riskCheck */ public function __construct( string $customFriendlyName = Values::NONE, string $customMessage = Values::NONE, string $sendDigits = Values::NONE, string $locale = Values::NONE, string $customCode = Values::NONE, string $amount = Values::NONE, string $payee = Values::NONE, array $rateLimits = Values::ARRAY_NONE, array $channelConfiguration = Values::ARRAY_NONE, string $appHash = Values::NONE, string $templateSid = Values::NONE, string $templateCustomSubstitutions = Values::NONE, string $deviceIp = Values::NONE, string $riskCheck = Values::NONE ) { $this->options['customFriendlyName'] = $customFriendlyName; $this->options['customMessage'] = $customMessage; $this->options['sendDigits'] = $sendDigits; $this->options['locale'] = $locale; $this->options['customCode'] = $customCode; $this->options['amount'] = $amount; $this->options['payee'] = $payee; $this->options['rateLimits'] = $rateLimits; $this->options['channelConfiguration'] = $channelConfiguration; $this->options['appHash'] = $appHash; $this->options['templateSid'] = $templateSid; $this->options['templateCustomSubstitutions'] = $templateCustomSubstitutions; $this->options['deviceIp'] = $deviceIp; $this->options['riskCheck'] = $riskCheck; } /** * A custom user defined friendly name that overwrites the existing one in the verification message * * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message * @return $this Fluent Builder */ public function setCustomFriendlyName(string $customFriendlyName): self { $this->options['customFriendlyName'] = $customFriendlyName; return $this; } /** * The text of a custom message to use for the verification. * * @param string $customMessage The text of a custom message to use for the verification. * @return $this Fluent Builder */ public function setCustomMessage(string $customMessage): self { $this->options['customMessage'] = $customMessage; return $this; } /** * The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). * * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). * @return $this Fluent Builder */ public function setSendDigits(string $sendDigits): self { $this->options['sendDigits'] = $sendDigits; return $this; } /** * Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). * * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). * @return $this Fluent Builder */ public function setLocale(string $locale): self { $this->options['locale'] = $locale; return $this; } /** * A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. * * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. * @return $this Fluent Builder */ public function setCustomCode(string $customCode): self { $this->options['customCode'] = $customCode; return $this; } /** * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return $this Fluent Builder */ public function setAmount(string $amount): self { $this->options['amount'] = $amount; return $this; } /** * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return $this Fluent Builder */ public function setPayee(string $payee): self { $this->options['payee'] = $payee; return $this; } /** * The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. * * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. * @return $this Fluent Builder */ public function setRateLimits(array $rateLimits): self { $this->options['rateLimits'] = $rateLimits; return $this; } /** * [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. * * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. * @return $this Fluent Builder */ public function setChannelConfiguration(array $channelConfiguration): self { $this->options['channelConfiguration'] = $channelConfiguration; return $this; } /** * Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. * * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. * @return $this Fluent Builder */ public function setAppHash(string $appHash): self { $this->options['appHash'] = $appHash; return $this; } /** * The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. * * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. * @return $this Fluent Builder */ public function setTemplateSid(string $templateSid): self { $this->options['templateSid'] = $templateSid; return $this; } /** * A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. * * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. * @return $this Fluent Builder */ public function setTemplateCustomSubstitutions(string $templateCustomSubstitutions): self { $this->options['templateCustomSubstitutions'] = $templateCustomSubstitutions; return $this; } /** * Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. * * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. * @return $this Fluent Builder */ public function setDeviceIp(string $deviceIp): self { $this->options['deviceIp'] = $deviceIp; return $this; } /** * @param string $riskCheck * @return $this Fluent Builder */ public function setRiskCheck(string $riskCheck): self { $this->options['riskCheck'] = $riskCheck; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateVerificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php000064400000006604150364341760021230 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'channel' => Values::array_get($payload, 'channel'), 'status' => Values::array_get($payload, 'status'), 'valid' => Values::array_get($payload, 'valid'), 'amount' => Values::array_get($payload, 'amount'), 'payee' => Values::array_get($payload, 'payee'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'snaAttemptsErrorCodes' => Values::array_get($payload, 'sna_attempts_error_codes'), ]; $this->solution = ['serviceSid' => $serviceSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationCheckInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php000064400000013653150364341760021121 0ustar00options['code'] = $code; $this->options['to'] = $to; $this->options['verificationSid'] = $verificationSid; $this->options['amount'] = $amount; $this->options['payee'] = $payee; } /** * The 4-10 character string being verified. * * @param string $code The 4-10 character string being verified. * @return $this Fluent Builder */ public function setCode(string $code): self { $this->options['code'] = $code; return $this; } /** * The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. * * @param string $verificationSid A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. * @return $this Fluent Builder */ public function setVerificationSid(string $verificationSid): self { $this->options['verificationSid'] = $verificationSid; return $this; } /** * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return $this Fluent Builder */ public function setAmount(string $amount): self { $this->options['amount'] = $amount; return $this; } /** * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return $this Fluent Builder */ public function setPayee(string $payee): self { $this->options['payee'] = $payee; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateVerificationCheckOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php000064400000005745150364341760020157 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Verifications/' . \rawurlencode($sid) .''; } /** * Fetch the VerificationInstance * * @return VerificationInstance Fetched VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VerificationInstance { $payload = $this->version->fetch('GET', $this->uri); return new VerificationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the VerificationInstance * * @param string $status * @return VerificationInstance Updated VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): VerificationInstance { $data = Values::of([ 'Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new VerificationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookPage.php000064400000003071150364341760016351 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\Verify\V2\Service\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.WebhookPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php000064400000006140150364341760017424 0ustar00options['description'] = $description; } /** * Description of this Rate Limit * * @param string $description Description of this Rate Limit * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateRateLimitOptions ' . $options . ']'; } } class UpdateRateLimitOptions extends Options { /** * @param string $description Description of this Rate Limit */ public function __construct( string $description = Values::NONE ) { $this->options['description'] = $description; } /** * Description of this Rate Limit * * @param string $description Description of this Rate Limit * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateRateLimitOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php000064400000012100150364341760017526 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'description' => Values::array_get($payload, 'description'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RateLimitContext Context for this RateLimitInstance */ protected function proxy(): RateLimitContext { if (!$this->context) { $this->context = new RateLimitContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RateLimitInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RateLimitInstance * * @return RateLimitInstance Fetched RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RateLimitInstance { return $this->proxy()->fetch(); } /** * Update the RateLimitInstance * * @param array|Options $options Optional Arguments * @return RateLimitInstance Updated RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RateLimitInstance { return $this->proxy()->update($options); } /** * Access the buckets */ protected function getBuckets(): BucketList { return $this->proxy()->buckets; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.RateLimitInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationList.php000064400000010105150364341760017430 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Verifications'; } /** * Create the VerificationInstance * * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @param string $channel The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, `sna` or `auto`. * @param array|Options $options Optional Arguments * @return VerificationInstance Created VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $channel, array $options = []): VerificationInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'Channel' => $channel, 'CustomFriendlyName' => $options['customFriendlyName'], 'CustomMessage' => $options['customMessage'], 'SendDigits' => $options['sendDigits'], 'Locale' => $options['locale'], 'CustomCode' => $options['customCode'], 'Amount' => $options['amount'], 'Payee' => $options['payee'], 'RateLimits' => Serialize::jsonObject($options['rateLimits']), 'ChannelConfiguration' => Serialize::jsonObject($options['channelConfiguration']), 'AppHash' => $options['appHash'], 'TemplateSid' => $options['templateSid'], 'TemplateCustomSubstitutions' => $options['templateCustomSubstitutions'], 'DeviceIp' => $options['deviceIp'], 'RiskCheck' => $options['riskCheck'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new VerificationInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Constructs a VerificationContext * * @param string $sid The Twilio-provided string that uniquely identifies the Verification resource to fetch. */ public function getContext( string $sid ): VerificationContext { return new VerificationContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationList]'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php000064400000004040150364341760020101 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Attempts/' . \rawurlencode($sid) .''; } /** * Fetch the VerificationAttemptInstance * * @return VerificationAttemptInstance Fetched VerificationAttemptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VerificationAttemptInstance { $payload = $this->version->fetch('GET', $this->uri); return new VerificationAttemptInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationAttemptContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryOptions.php000064400000017604150364341760021663 0ustar00options['verifyServiceSid'] = $verifyServiceSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['country'] = $country; $this->options['channel'] = $channel; $this->options['destinationPrefix'] = $destinationPrefix; } /** * Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. * * @param string $verifyServiceSid Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. * @return $this Fluent Builder */ public function setVerifyServiceSid(string $verifyServiceSid): self { $this->options['verifyServiceSid'] = $verifyServiceSid; return $this; } /** * Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. * * @param string $country Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. * @return $this Fluent Builder */ public function setCountry(string $country): self { $this->options['country'] = $country; return $this; } /** * Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` * * @param string $channel Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` * @return $this Fluent Builder */ public function setChannel(string $channel): self { $this->options['channel'] = $channel; return $this; } /** * Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. * * @param string $destinationPrefix Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. * @return $this Fluent Builder */ public function setDestinationPrefix(string $destinationPrefix): self { $this->options['destinationPrefix'] = $destinationPrefix; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.FetchVerificationAttemptsSummaryOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceOptions.php000064400000117167150364341760015546 0ustar00options['codeLength'] = $codeLength; $this->options['lookupEnabled'] = $lookupEnabled; $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; $this->options['dtmfInputRequired'] = $dtmfInputRequired; $this->options['ttsName'] = $ttsName; $this->options['psd2Enabled'] = $psd2Enabled; $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; $this->options['customCodeEnabled'] = $customCodeEnabled; $this->options['pushIncludeDate'] = $pushIncludeDate; $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; $this->options['totpIssuer'] = $totpIssuer; $this->options['totpTimeStep'] = $totpTimeStep; $this->options['totpCodeLength'] = $totpCodeLength; $this->options['totpSkew'] = $totpSkew; $this->options['defaultTemplateSid'] = $defaultTemplateSid; } /** * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @return $this Fluent Builder */ public function setCodeLength(int $codeLength): self { $this->options['codeLength'] = $codeLength; return $this; } /** * Whether to perform a lookup with each verification started and return info about the phone number. * * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @return $this Fluent Builder */ public function setLookupEnabled(bool $lookupEnabled): self { $this->options['lookupEnabled'] = $lookupEnabled; return $this; } /** * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @return $this Fluent Builder */ public function setSkipSmsToLandlines(bool $skipSmsToLandlines): self { $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; return $this; } /** * Whether to ask the user to press a number before delivering the verify code in a phone call. * * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @return $this Fluent Builder */ public function setDtmfInputRequired(bool $dtmfInputRequired): self { $this->options['dtmfInputRequired'] = $dtmfInputRequired; return $this; } /** * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @return $this Fluent Builder */ public function setTtsName(string $ttsName): self { $this->options['ttsName'] = $ttsName; return $this; } /** * Whether to pass PSD2 transaction parameters when starting a verification. * * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @return $this Fluent Builder */ public function setPsd2Enabled(bool $psd2Enabled): self { $this->options['psd2Enabled'] = $psd2Enabled; return $this; } /** * Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` * * @param bool $doNotShareWarningEnabled Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` * @return $this Fluent Builder */ public function setDoNotShareWarningEnabled(bool $doNotShareWarningEnabled): self { $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; return $this; } /** * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @return $this Fluent Builder */ public function setCustomCodeEnabled(bool $customCodeEnabled): self { $this->options['customCodeEnabled'] = $customCodeEnabled; return $this; } /** * Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. * * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. * @return $this Fluent Builder */ public function setPushIncludeDate(bool $pushIncludeDate): self { $this->options['pushIncludeDate'] = $pushIncludeDate; return $this; } /** * Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @return $this Fluent Builder */ public function setPushApnCredentialSid(string $pushApnCredentialSid): self { $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; return $this; } /** * Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @return $this Fluent Builder */ public function setPushFcmCredentialSid(string $pushFcmCredentialSid): self { $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; return $this; } /** * Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. * * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. * @return $this Fluent Builder */ public function setTotpIssuer(string $totpIssuer): self { $this->options['totpIssuer'] = $totpIssuer; return $this; } /** * Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @return $this Fluent Builder */ public function setTotpTimeStep(int $totpTimeStep): self { $this->options['totpTimeStep'] = $totpTimeStep; return $this; } /** * Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @return $this Fluent Builder */ public function setTotpCodeLength(int $totpCodeLength): self { $this->options['totpCodeLength'] = $totpCodeLength; return $this; } /** * Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @return $this Fluent Builder */ public function setTotpSkew(int $totpSkew): self { $this->options['totpSkew'] = $totpSkew; return $this; } /** * The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * @return $this Fluent Builder */ public function setDefaultTemplateSid(string $defaultTemplateSid): self { $this->options['defaultTemplateSid'] = $defaultTemplateSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. */ public function __construct( string $friendlyName = Values::NONE, int $codeLength = Values::INT_NONE, bool $lookupEnabled = Values::BOOL_NONE, bool $skipSmsToLandlines = Values::BOOL_NONE, bool $dtmfInputRequired = Values::BOOL_NONE, string $ttsName = Values::NONE, bool $psd2Enabled = Values::BOOL_NONE, bool $doNotShareWarningEnabled = Values::BOOL_NONE, bool $customCodeEnabled = Values::BOOL_NONE, bool $pushIncludeDate = Values::BOOL_NONE, string $pushApnCredentialSid = Values::NONE, string $pushFcmCredentialSid = Values::NONE, string $totpIssuer = Values::NONE, int $totpTimeStep = Values::INT_NONE, int $totpCodeLength = Values::INT_NONE, int $totpSkew = Values::INT_NONE, string $defaultTemplateSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['codeLength'] = $codeLength; $this->options['lookupEnabled'] = $lookupEnabled; $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; $this->options['dtmfInputRequired'] = $dtmfInputRequired; $this->options['ttsName'] = $ttsName; $this->options['psd2Enabled'] = $psd2Enabled; $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; $this->options['customCodeEnabled'] = $customCodeEnabled; $this->options['pushIncludeDate'] = $pushIncludeDate; $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; $this->options['totpIssuer'] = $totpIssuer; $this->options['totpTimeStep'] = $totpTimeStep; $this->options['totpCodeLength'] = $totpCodeLength; $this->options['totpSkew'] = $totpSkew; $this->options['defaultTemplateSid'] = $defaultTemplateSid; } /** * A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @return $this Fluent Builder */ public function setCodeLength(int $codeLength): self { $this->options['codeLength'] = $codeLength; return $this; } /** * Whether to perform a lookup with each verification started and return info about the phone number. * * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @return $this Fluent Builder */ public function setLookupEnabled(bool $lookupEnabled): self { $this->options['lookupEnabled'] = $lookupEnabled; return $this; } /** * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @return $this Fluent Builder */ public function setSkipSmsToLandlines(bool $skipSmsToLandlines): self { $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; return $this; } /** * Whether to ask the user to press a number before delivering the verify code in a phone call. * * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @return $this Fluent Builder */ public function setDtmfInputRequired(bool $dtmfInputRequired): self { $this->options['dtmfInputRequired'] = $dtmfInputRequired; return $this; } /** * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @return $this Fluent Builder */ public function setTtsName(string $ttsName): self { $this->options['ttsName'] = $ttsName; return $this; } /** * Whether to pass PSD2 transaction parameters when starting a verification. * * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @return $this Fluent Builder */ public function setPsd2Enabled(bool $psd2Enabled): self { $this->options['psd2Enabled'] = $psd2Enabled; return $this; } /** * Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** * * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** * @return $this Fluent Builder */ public function setDoNotShareWarningEnabled(bool $doNotShareWarningEnabled): self { $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; return $this; } /** * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @return $this Fluent Builder */ public function setCustomCodeEnabled(bool $customCodeEnabled): self { $this->options['customCodeEnabled'] = $customCodeEnabled; return $this; } /** * Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. * * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. * @return $this Fluent Builder */ public function setPushIncludeDate(bool $pushIncludeDate): self { $this->options['pushIncludeDate'] = $pushIncludeDate; return $this; } /** * Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @return $this Fluent Builder */ public function setPushApnCredentialSid(string $pushApnCredentialSid): self { $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; return $this; } /** * Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @return $this Fluent Builder */ public function setPushFcmCredentialSid(string $pushFcmCredentialSid): self { $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; return $this; } /** * Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. * * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. * @return $this Fluent Builder */ public function setTotpIssuer(string $totpIssuer): self { $this->options['totpIssuer'] = $totpIssuer; return $this; } /** * Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @return $this Fluent Builder */ public function setTotpTimeStep(int $totpTimeStep): self { $this->options['totpTimeStep'] = $totpTimeStep; return $this; } /** * Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @return $this Fluent Builder */ public function setTotpCodeLength(int $totpCodeLength): self { $this->options['totpCodeLength'] = $totpCodeLength; return $this; } /** * Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @return $this Fluent Builder */ public function setTotpSkew(int $totpSkew): self { $this->options['totpSkew'] = $totpSkew; return $this; } /** * The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * @return $this Fluent Builder */ public function setDefaultTemplateSid(string $defaultTemplateSid): self { $this->options['defaultTemplateSid'] = $defaultTemplateSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceList.php000064400000016627150364341760015025 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'CodeLength' => $options['codeLength'], 'LookupEnabled' => Serialize::booleanToString($options['lookupEnabled']), 'SkipSmsToLandlines' => Serialize::booleanToString($options['skipSmsToLandlines']), 'DtmfInputRequired' => Serialize::booleanToString($options['dtmfInputRequired']), 'TtsName' => $options['ttsName'], 'Psd2Enabled' => Serialize::booleanToString($options['psd2Enabled']), 'DoNotShareWarningEnabled' => Serialize::booleanToString($options['doNotShareWarningEnabled']), 'CustomCodeEnabled' => Serialize::booleanToString($options['customCodeEnabled']), 'Push.IncludeDate' => Serialize::booleanToString($options['pushIncludeDate']), 'Push.ApnCredentialSid' => $options['pushApnCredentialSid'], 'Push.FcmCredentialSid' => $options['pushFcmCredentialSid'], 'Totp.Issuer' => $options['totpIssuer'], 'Totp.TimeStep' => $options['totpTimeStep'], 'Totp.CodeLength' => $options['totpCodeLength'], 'Totp.Skew' => $options['totpSkew'], 'DefaultTemplateSid' => $options['defaultTemplateSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The Twilio-provided string that uniquely identifies the Verification Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.ServiceList]'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptOptions.php000064400000022712150364341760020116 0ustar00options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['channelDataTo'] = $channelDataTo; $this->options['country'] = $country; $this->options['channel'] = $channel; $this->options['verifyServiceSid'] = $verifyServiceSid; $this->options['verificationSid'] = $verificationSid; $this->options['status'] = $status; } /** * Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Destination of a verification. It is phone number in E.164 format. * * @param string $channelDataTo Destination of a verification. It is phone number in E.164 format. * @return $this Fluent Builder */ public function setChannelDataTo(string $channelDataTo): self { $this->options['channelDataTo'] = $channelDataTo; return $this; } /** * Filter used to query Verification Attempts sent to the specified destination country. * * @param string $country Filter used to query Verification Attempts sent to the specified destination country. * @return $this Fluent Builder */ public function setCountry(string $country): self { $this->options['country'] = $country; return $this; } /** * Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` * * @param string $channel Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` * @return $this Fluent Builder */ public function setChannel(string $channel): self { $this->options['channel'] = $channel; return $this; } /** * Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. * * @param string $verifyServiceSid Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. * @return $this Fluent Builder */ public function setVerifyServiceSid(string $verifyServiceSid): self { $this->options['verifyServiceSid'] = $verifyServiceSid; return $this; } /** * Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. * * @param string $verificationSid Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. * @return $this Fluent Builder */ public function setVerificationSid(string $verificationSid): self { $this->options['verificationSid'] = $verificationSid; return $this; } /** * Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. * * @param string $status Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.ReadVerificationAttemptOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptList.php000064400000014272150364341760017400 0ustar00solution = [ ]; $this->uri = '/Attempts'; } /** * Reads VerificationAttemptInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return VerificationAttemptInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams VerificationAttemptInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of VerificationAttemptInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return VerificationAttemptPage Page of VerificationAttemptInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): VerificationAttemptPage { $options = new Values($options); $params = Values::of([ 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'ChannelData.To' => $options['channelDataTo'], 'Country' => $options['country'], 'Channel' => $options['channel'], 'VerifyServiceSid' => $options['verifyServiceSid'], 'VerificationSid' => $options['verificationSid'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new VerificationAttemptPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of VerificationAttemptInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return VerificationAttemptPage Page of VerificationAttemptInstance */ public function getPage(string $targetUrl): VerificationAttemptPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new VerificationAttemptPage($this->version, $response, $this->solution); } /** * Constructs a VerificationAttemptContext * * @param string $sid The unique SID identifier of a Verification Attempt */ public function getContext( string $sid ): VerificationAttemptContext { return new VerificationAttemptContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationAttemptList]'; } } sdk/src/Twilio/Rest/Verify/V2/FormPage.php000064400000002770150364341760014263 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return FormInstance \Twilio\Rest\Verify\V2\FormInstance */ public function buildInstance(array $payload): FormInstance { return new FormInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.FormPage]'; } } sdk/src/Twilio/Rest/Verify/V2/TemplateList.php000064400000012133150364341760015164 0ustar00solution = [ ]; $this->uri = '/Templates'; } /** * Reads TemplateInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TemplateInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TemplateInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TemplateInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TemplatePage Page of TemplateInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TemplatePage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TemplatePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TemplateInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TemplatePage Page of TemplateInstance */ public function getPage(string $targetUrl): TemplatePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TemplatePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.TemplateList]'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryList.php000064400000002675150364341760021145 0ustar00solution = [ ]; } /** * Constructs a VerificationAttemptsSummaryContext */ public function getContext( ): VerificationAttemptsSummaryContext { return new VerificationAttemptsSummaryContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationAttemptsSummaryList]'; } } sdk/src/Twilio/Rest/Verify/V2/ServicePage.php000064400000003012150364341760014746 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Verify\V2\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.ServicePage]'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryPage.php000064400000003202150364341760021071 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return VerificationAttemptsSummaryInstance \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryInstance */ public function buildInstance(array $payload): VerificationAttemptsSummaryInstance { return new VerificationAttemptsSummaryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationAttemptsSummaryPage]'; } } sdk/src/Twilio/Rest/Verify/V2/FormContext.php000064400000003717150364341760015035 0ustar00solution = [ 'formType' => $formType, ]; $this->uri = '/Forms/' . \rawurlencode($formType) .''; } /** * Fetch the FormInstance * * @return FormInstance Fetched FormInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FormInstance { $payload = $this->version->fetch('GET', $this->uri); return new FormInstance( $this->version, $payload, $this->solution['formType'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.FormContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/SafelistContext.php000064400000004563150364341760015704 0ustar00solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/SafeList/Numbers/' . \rawurlencode($phoneNumber) .''; } /** * Delete the SafelistInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SafelistInstance * * @return SafelistInstance Fetched SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SafelistInstance { $payload = $this->version->fetch('GET', $this->uri); return new SafelistInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.SafelistContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceContext.php000064400000022521150364341760015524 0ustar00solution = [ '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'], 'CodeLength' => $options['codeLength'], 'LookupEnabled' => Serialize::booleanToString($options['lookupEnabled']), 'SkipSmsToLandlines' => Serialize::booleanToString($options['skipSmsToLandlines']), 'DtmfInputRequired' => Serialize::booleanToString($options['dtmfInputRequired']), 'TtsName' => $options['ttsName'], 'Psd2Enabled' => Serialize::booleanToString($options['psd2Enabled']), 'DoNotShareWarningEnabled' => Serialize::booleanToString($options['doNotShareWarningEnabled']), 'CustomCodeEnabled' => Serialize::booleanToString($options['customCodeEnabled']), 'Push.IncludeDate' => Serialize::booleanToString($options['pushIncludeDate']), 'Push.ApnCredentialSid' => $options['pushApnCredentialSid'], 'Push.FcmCredentialSid' => $options['pushFcmCredentialSid'], 'Totp.Issuer' => $options['totpIssuer'], 'Totp.TimeStep' => $options['totpTimeStep'], 'Totp.CodeLength' => $options['totpCodeLength'], 'Totp.Skew' => $options['totpSkew'], 'DefaultTemplateSid' => $options['defaultTemplateSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the entities */ protected function getEntities(): EntityList { if (!$this->_entities) { $this->_entities = new EntityList( $this->version, $this->solution['sid'] ); } return $this->_entities; } /** * Access the verificationChecks */ protected function getVerificationChecks(): VerificationCheckList { if (!$this->_verificationChecks) { $this->_verificationChecks = new VerificationCheckList( $this->version, $this->solution['sid'] ); } return $this->_verificationChecks; } /** * Access the verifications */ protected function getVerifications(): VerificationList { if (!$this->_verifications) { $this->_verifications = new VerificationList( $this->version, $this->solution['sid'] ); } return $this->_verifications; } /** * Access the accessTokens */ protected function getAccessTokens(): AccessTokenList { if (!$this->_accessTokens) { $this->_accessTokens = new AccessTokenList( $this->version, $this->solution['sid'] ); } return $this->_accessTokens; } /** * Access the rateLimits */ protected function getRateLimits(): RateLimitList { if (!$this->_rateLimits) { $this->_rateLimits = new RateLimitList( $this->version, $this->solution['sid'] ); } return $this->_rateLimits; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the messagingConfigurations */ protected function getMessagingConfigurations(): MessagingConfigurationList { if (!$this->_messagingConfigurations) { $this->_messagingConfigurations = new MessagingConfigurationList( $this->version, $this->solution['sid'] ); } return $this->_messagingConfigurations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/SafelistList.php000064400000004512150364341760015165 0ustar00solution = [ ]; $this->uri = '/SafeList/Numbers'; } /** * Create the SafelistInstance * * @param string $phoneNumber The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return SafelistInstance Created SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber): SafelistInstance { $data = Values::of([ 'PhoneNumber' => $phoneNumber, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SafelistInstance( $this->version, $payload ); } /** * Constructs a SafelistContext * * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ public function getContext( string $phoneNumber ): SafelistContext { return new SafelistContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.SafelistList]'; } } sdk/src/Twilio/Rest/Verify/V2/TemplateInstance.php000064400000004623150364341760016022 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'channels' => Values::array_get($payload, 'channels'), 'translations' => Values::array_get($payload, 'translations'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.TemplateInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/FormInstance.php000064400000006502150364341760015150 0ustar00properties = [ 'formType' => Values::array_get($payload, 'form_type'), 'forms' => Values::array_get($payload, 'forms'), 'formMeta' => Values::array_get($payload, 'form_meta'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['formType' => $formType ?: $this->properties['formType'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FormContext Context for this FormInstance */ protected function proxy(): FormContext { if (!$this->context) { $this->context = new FormContext( $this->version, $this->solution['formType'] ); } return $this->context; } /** * Fetch the FormInstance * * @return FormInstance Fetched FormInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FormInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.FormInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryInstance.php000064400000007240150364341760021767 0ustar00properties = [ 'totalAttempts' => Values::array_get($payload, 'total_attempts'), 'totalConverted' => Values::array_get($payload, 'total_converted'), 'totalUnconverted' => Values::array_get($payload, 'total_unconverted'), 'conversionRatePercentage' => Values::array_get($payload, 'conversion_rate_percentage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return VerificationAttemptsSummaryContext Context for this VerificationAttemptsSummaryInstance */ protected function proxy(): VerificationAttemptsSummaryContext { if (!$this->context) { $this->context = new VerificationAttemptsSummaryContext( $this->version ); } return $this->context; } /** * Fetch the VerificationAttemptsSummaryInstance * * @param array|Options $options Optional Arguments * @return VerificationAttemptsSummaryInstance Fetched VerificationAttemptsSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): VerificationAttemptsSummaryInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationAttemptsSummaryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/FormList.php000064400000002711150364341760014315 0ustar00solution = [ ]; } /** * Constructs a FormContext * * @param string $formType The Type of this Form. Currently only `form-push` is supported. */ public function getContext( string $formType ): FormContext { return new FormContext( $this->version, $formType ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.FormList]'; } } sdk/src/Twilio/Rest/Verify/V2/TemplateOptions.php000064400000003741150364341760015711 0ustar00options['friendlyName'] = $friendlyName; } /** * String filter used to query templates with a given friendly name. * * @param string $friendlyName String filter used to query templates with a given friendly name. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.ReadTemplateOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/TemplatePage.php000064400000003020150364341760015120 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return TemplateInstance \Twilio\Rest\Verify\V2\TemplateInstance */ public function buildInstance(array $payload): TemplateInstance { return new TemplateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.TemplatePage]'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceInstance.php000064400000016543150364341760015653 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'codeLength' => Values::array_get($payload, 'code_length'), 'lookupEnabled' => Values::array_get($payload, 'lookup_enabled'), 'psd2Enabled' => Values::array_get($payload, 'psd2_enabled'), 'skipSmsToLandlines' => Values::array_get($payload, 'skip_sms_to_landlines'), 'dtmfInputRequired' => Values::array_get($payload, 'dtmf_input_required'), 'ttsName' => Values::array_get($payload, 'tts_name'), 'doNotShareWarningEnabled' => Values::array_get($payload, 'do_not_share_warning_enabled'), 'customCodeEnabled' => Values::array_get($payload, 'custom_code_enabled'), 'push' => Values::array_get($payload, 'push'), 'totp' => Values::array_get($payload, 'totp'), 'defaultTemplateSid' => Values::array_get($payload, 'default_template_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the entities */ protected function getEntities(): EntityList { return $this->proxy()->entities; } /** * Access the verificationChecks */ protected function getVerificationChecks(): VerificationCheckList { return $this->proxy()->verificationChecks; } /** * Access the verifications */ protected function getVerifications(): VerificationList { return $this->proxy()->verifications; } /** * Access the accessTokens */ protected function getAccessTokens(): AccessTokenList { return $this->proxy()->accessTokens; } /** * Access the rateLimits */ protected function getRateLimits(): RateLimitList { return $this->proxy()->rateLimits; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the messagingConfigurations */ protected function getMessagingConfigurations(): MessagingConfigurationList { return $this->proxy()->messagingConfigurations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptInstance.php000064400000010425150364341760020225 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'verificationSid' => Values::array_get($payload, 'verification_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'conversionStatus' => Values::array_get($payload, 'conversion_status'), 'channel' => Values::array_get($payload, 'channel'), 'price' => Values::array_get($payload, 'price'), 'channelData' => Values::array_get($payload, 'channel_data'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return VerificationAttemptContext Context for this VerificationAttemptInstance */ protected function proxy(): VerificationAttemptContext { if (!$this->context) { $this->context = new VerificationAttemptContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the VerificationAttemptInstance * * @return VerificationAttemptInstance Fetched VerificationAttemptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VerificationAttemptInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationAttemptInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/SafelistPage.php000064400000003020150364341760015117 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SafelistInstance \Twilio\Rest\Verify\V2\SafelistInstance */ public function buildInstance(array $payload): SafelistInstance { return new SafelistInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.SafelistPage]'; } } sdk/src/Twilio/Rest/Verify/V2.php000064400000011022150364341760012551 0ustar00version = 'v2'; } protected function getForms(): FormList { if (!$this->_forms) { $this->_forms = new FormList($this); } return $this->_forms; } protected function getSafelist(): SafelistList { if (!$this->_safelist) { $this->_safelist = new SafelistList($this); } return $this->_safelist; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } protected function getTemplates(): TemplateList { if (!$this->_templates) { $this->_templates = new TemplateList($this); } return $this->_templates; } protected function getVerificationAttempts(): VerificationAttemptList { if (!$this->_verificationAttempts) { $this->_verificationAttempts = new VerificationAttemptList($this); } return $this->_verificationAttempts; } protected function getVerificationAttemptsSummary(): VerificationAttemptsSummaryList { if (!$this->_verificationAttemptsSummary) { $this->_verificationAttemptsSummary = new VerificationAttemptsSummaryList($this); } return $this->_verificationAttemptsSummary; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2]'; } } sdk/src/Twilio/Rest/Bulkexports.php000064400000003252150364341760013346 0ustar00exports instead. */ protected function getExports(): \Twilio\Rest\Bulkexports\V1\ExportList { echo "exports is deprecated. Use v1->exports instead."; return $this->v1->exports; } /** * @deprecated Use v1->exports(\$resourceType) instead. * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ protected function contextExports(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportContext { echo "exports(\$resourceType) is deprecated. Use v1->exports(\$resourceType) instead."; return $this->v1->exports($resourceType); } /** * @deprecated Use v1->exportConfiguration instead. */ protected function getExportConfiguration(): \Twilio\Rest\Bulkexports\V1\ExportConfigurationList { echo "exportConfiguration is deprecated. Use v1->exportConfiguration instead."; return $this->v1->exportConfiguration; } /** * @deprecated Use v1->exportConfiguration(\$resourceType) instead. * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ protected function contextExportConfiguration(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportConfigurationContext { echo "rexportConfiguration(\$resourceType) is deprecated. Use v1->exportConfiguration(\$resourceType) instead."; return $this->v1->exportConfiguration($resourceType); } }sdk/src/Twilio/Rest/Notify.php000064400000002501150364341760012270 0ustar00credentials instead. */ protected function getCredentials(): \Twilio\Rest\Notify\V1\CredentialList { echo "credentials is deprecated. Use v1->credentials instead."; return $this->v1->credentials; } /** * @deprecated Use v1->credentials(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextCredentials(string $sid): \Twilio\Rest\Notify\V1\CredentialContext { echo "credentials(\$sid) is deprecated. Use v1->credentials(\$sid) instead."; return $this->v1->credentials($sid); } /** * @deprecated Use v1->services instead. */ protected function getServices(): \Twilio\Rest\Notify\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextServices(string $sid): \Twilio\Rest\Notify\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } }sdk/src/Twilio/Rest/MicrovisorBase.php000064400000004556150364341760013763 0ustar00baseUrl = 'https://microvisor.twilio.com'; } /** * @return V1 Version v1 of microvisor */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor]'; } } sdk/src/Twilio/Rest/Insights/V1.php000064400000007623150364341760013110 0ustar00version = 'v1'; } protected function getCalls(): CallList { if (!$this->_calls) { $this->_calls = new CallList($this); } return $this->_calls; } protected function getCallSummaries(): CallSummariesList { if (!$this->_callSummaries) { $this->_callSummaries = new CallSummariesList($this); } return $this->_callSummaries; } protected function getConferences(): ConferenceList { if (!$this->_conferences) { $this->_conferences = new ConferenceList($this); } return $this->_conferences; } protected function getRooms(): RoomList { if (!$this->_rooms) { $this->_rooms = new RoomList($this); } return $this->_rooms; } protected function getSettings(): SettingList { if (!$this->_settings) { $this->_settings = new SettingList($this); } return $this->_settings; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1]'; } } sdk/src/Twilio/Rest/Insights/V1/RoomPage.php000064400000003000150364341760014602 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/ConferenceInstance.php000064400000013726150364341760016645 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/CallContext.php000064400000011467150364341760015331 0ustar00solution = [ '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 metrics */ protected function getMetrics(): MetricList { if (!$this->_metrics) { $this->_metrics = new MetricList( $this->version, $this->solution['sid'] ); } return $this->_metrics; } /** * Access the events */ protected function getEvents(): EventList { if (!$this->_events) { $this->_events = new EventList( $this->version, $this->solution['sid'] ); } return $this->_events; } /** * Access the summary */ protected function getSummary(): CallSummaryList { if (!$this->_summary) { $this->_summary = new CallSummaryList( $this->version, $this->solution['sid'] ); } return $this->_summary; } /** * Access the annotation */ protected function getAnnotation(): AnnotationList { if (!$this->_annotation) { $this->_annotation = new AnnotationList( $this->version, $this->solution['sid'] ); } return $this->_annotation; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Insights.V1.CallContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/SettingContext.php000064400000005576150364341760016077 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/ConferenceContext.php000064400000007562150364341760016526 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/CallSummariesInstance.php000064400000010454150364341760017332 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'answeredBy' => Values::array_get($payload, 'answered_by'), 'callType' => Values::array_get($payload, 'call_type'), 'callState' => Values::array_get($payload, 'call_state'), 'processingState' => Values::array_get($payload, 'processing_state'), 'createdTime' => Deserialize::dateTime(Values::array_get($payload, 'created_time')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'connectDuration' => Values::array_get($payload, 'connect_duration'), 'from' => Values::array_get($payload, 'from'), 'to' => Values::array_get($payload, 'to'), 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), 'clientEdge' => Values::array_get($payload, 'client_edge'), 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), 'sipEdge' => Values::array_get($payload, 'sip_edge'), 'tags' => Values::array_get($payload, 'tags'), 'url' => Values::array_get($payload, 'url'), 'attributes' => Values::array_get($payload, 'attributes'), 'properties' => Values::array_get($payload, 'properties'), 'trust' => Values::array_get($payload, 'trust'), 'annotation' => Values::array_get($payload, 'annotation'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.CallSummariesInstance]'; } } sdk/src/Twilio/Rest/Insights/V1/ConferencePage.php000064400000003044150364341760015745 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/CallSummariesPage.php000064400000003066150364341760016443 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/ConferenceList.php000064400000014116150364341760016006 0ustar00solution = [ ]; $this->uri = '/Conferences'; } /** * Reads ConferenceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConferenceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ConferenceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConferenceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConferencePage Page of ConferenceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConferencePage { $options = new Values($options); $params = Values::of([ 'ConferenceSid' => $options['conferenceSid'], 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], 'CreatedAfter' => $options['createdAfter'], 'CreatedBefore' => $options['createdBefore'], 'MixerRegion' => $options['mixerRegion'], 'Tags' => $options['tags'], 'Subaccount' => $options['subaccount'], 'DetectedIssues' => $options['detectedIssues'], 'EndReason' => $options['endReason'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConferencePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConferenceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConferencePage Page of ConferenceInstance */ public function getPage(string $targetUrl): ConferencePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConferencePage($this->version, $response, $this->solution); } /** * Constructs a ConferenceContext * * @param string $conferenceSid The unique SID identifier of the Conference. */ public function getContext( string $conferenceSid ): ConferenceContext { return new ConferenceContext( $this->version, $conferenceSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.ConferenceList]'; } } sdk/src/Twilio/Rest/Insights/V1/CallList.php000064400000002601150364341760014606 0ustar00solution = [ ]; } /** * Constructs a CallContext * * @param string $sid */ public function getContext( string $sid ): CallContext { return new CallContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.CallList]'; } } sdk/src/Twilio/Rest/Insights/V1/SettingList.php000064400000002513150364341760015352 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Insights/V1/SettingOptions.php000064400000011154150364341760016073 0ustar00options['subaccountSid'] = $subaccountSid; } /** * The unique SID identifier of the Subaccount. * * @param string $subaccountSid The unique SID identifier of the Subaccount. * @return $this Fluent Builder */ public function setSubaccountSid(string $subaccountSid): self { $this->options['subaccountSid'] = $subaccountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.FetchSettingOptions ' . $options . ']'; } } class UpdateSettingOptions extends Options { /** * @param bool $advancedFeatures A boolean flag to enable Advanced Features for Voice Insights. * @param bool $voiceTrace A boolean flag to enable Voice Trace. * @param string $subaccountSid The unique SID identifier of the Subaccount. */ public function __construct( bool $advancedFeatures = Values::BOOL_NONE, bool $voiceTrace = Values::BOOL_NONE, string $subaccountSid = Values::NONE ) { $this->options['advancedFeatures'] = $advancedFeatures; $this->options['voiceTrace'] = $voiceTrace; $this->options['subaccountSid'] = $subaccountSid; } /** * A boolean flag to enable Advanced Features for Voice Insights. * * @param bool $advancedFeatures A boolean flag to enable Advanced Features for Voice Insights. * @return $this Fluent Builder */ public function setAdvancedFeatures(bool $advancedFeatures): self { $this->options['advancedFeatures'] = $advancedFeatures; return $this; } /** * A boolean flag to enable Voice Trace. * * @param bool $voiceTrace A boolean flag to enable Voice Trace. * @return $this Fluent Builder */ public function setVoiceTrace(bool $voiceTrace): self { $this->options['voiceTrace'] = $voiceTrace; return $this; } /** * The unique SID identifier of the Subaccount. * * @param string $subaccountSid The unique SID identifier of the Subaccount. * @return $this Fluent Builder */ public function setSubaccountSid(string $subaccountSid): self { $this->options['subaccountSid'] = $subaccountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.UpdateSettingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/RoomInstance.php000064400000014331150364341760015503 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/CallPage.php000064400000003000150364341760014541 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/CallInstance.php000064400000007747150364341760015457 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CallContext Context for this CallInstance */ protected function proxy(): CallContext { if (!$this->context) { $this->context = new CallContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the CallInstance * * @return CallInstance Fetched CallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CallInstance { return $this->proxy()->fetch(); } /** * Access the metrics */ protected function getMetrics(): MetricList { return $this->proxy()->metrics; } /** * Access the events */ protected function getEvents(): EventList { return $this->proxy()->events; } /** * Access the summary */ protected function getSummary(): CallSummaryList { return $this->proxy()->summary; } /** * Access the annotation */ protected function getAnnotation(): AnnotationList { return $this->proxy()->annotation; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Insights.V1.CallInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/CallSummariesOptions.php000064400000053510150364341760017221 0ustar00options['from'] = $from; $this->options['to'] = $to; $this->options['fromCarrier'] = $fromCarrier; $this->options['toCarrier'] = $toCarrier; $this->options['fromCountryCode'] = $fromCountryCode; $this->options['toCountryCode'] = $toCountryCode; $this->options['branded'] = $branded; $this->options['verifiedCaller'] = $verifiedCaller; $this->options['hasTag'] = $hasTag; $this->options['startTime'] = $startTime; $this->options['endTime'] = $endTime; $this->options['callType'] = $callType; $this->options['callState'] = $callState; $this->options['direction'] = $direction; $this->options['processingState'] = $processingState; $this->options['sortBy'] = $sortBy; $this->options['subaccount'] = $subaccount; $this->options['abnormalSession'] = $abnormalSession; $this->options['answeredBy'] = $answeredBy; $this->options['answeredByAnnotation'] = $answeredByAnnotation; $this->options['connectivityIssueAnnotation'] = $connectivityIssueAnnotation; $this->options['qualityIssueAnnotation'] = $qualityIssueAnnotation; $this->options['spamAnnotation'] = $spamAnnotation; $this->options['callScoreAnnotation'] = $callScoreAnnotation; } /** * A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. * * @param string $from A calling party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. * * @param string $to A called party. Could be an E.164 number, a SIP URI, or a Twilio Client registered name. * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * An origination carrier. * * @param string $fromCarrier An origination carrier. * @return $this Fluent Builder */ public function setFromCarrier(string $fromCarrier): self { $this->options['fromCarrier'] = $fromCarrier; return $this; } /** * A destination carrier. * * @param string $toCarrier A destination carrier. * @return $this Fluent Builder */ public function setToCarrier(string $toCarrier): self { $this->options['toCarrier'] = $toCarrier; return $this; } /** * A source country code based on phone number in From. * * @param string $fromCountryCode A source country code based on phone number in From. * @return $this Fluent Builder */ public function setFromCountryCode(string $fromCountryCode): self { $this->options['fromCountryCode'] = $fromCountryCode; return $this; } /** * A destination country code. Based on phone number in To. * * @param string $toCountryCode A destination country code. Based on phone number in To. * @return $this Fluent Builder */ public function setToCountryCode(string $toCountryCode): self { $this->options['toCountryCode'] = $toCountryCode; return $this; } /** * A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. * * @param bool $branded A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. * @return $this Fluent Builder */ public function setBranded(bool $branded): self { $this->options['branded'] = $branded; return $this; } /** * A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. * * @param bool $verifiedCaller A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. * @return $this Fluent Builder */ public function setVerifiedCaller(bool $verifiedCaller): self { $this->options['verifiedCaller'] = $verifiedCaller; return $this; } /** * A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). * * @param bool $hasTag A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). * @return $this Fluent Builder */ public function setHasTag(bool $hasTag): self { $this->options['hasTag'] = $hasTag; return $this; } /** * A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. * * @param string $startTime A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. * @return $this Fluent Builder */ public function setStartTime(string $startTime): self { $this->options['startTime'] = $startTime; return $this; } /** * An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. * * @param string $endTime An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. * @return $this Fluent Builder */ public function setEndTime(string $endTime): self { $this->options['endTime'] = $endTime; return $this; } /** * A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`. * * @param string $callType A Call Type of the calls. One of `carrier`, `sip`, `trunking` or `client`. * @return $this Fluent Builder */ public function setCallType(string $callType): self { $this->options['callType'] = $callType; return $this; } /** * A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`. * * @param string $callState A Call State of the calls. One of `ringing`, `completed`, `busy`, `fail`, `noanswer`, `canceled`, `answered`, `undialed`. * @return $this Fluent Builder */ public function setCallState(string $callState): self { $this->options['callState'] = $callState; return $this; } /** * A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`. * * @param string $direction A Direction of the calls. One of `outbound_api`, `outbound_dial`, `inbound`, `trunking_originating`, `trunking_terminating`. * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * A Processing State of the Call Summaries. One of `completed`, `partial` or `all`. * * @param string $processingState A Processing State of the Call Summaries. One of `completed`, `partial` or `all`. * @return $this Fluent Builder */ public function setProcessingState(string $processingState): self { $this->options['processingState'] = $processingState; return $this; } /** * A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`. * * @param string $sortBy A Sort By criterion for the returned list of Call Summaries. One of `start_time` or `end_time`. * @return $this Fluent Builder */ public function setSortBy(string $sortBy): self { $this->options['sortBy'] = $sortBy; return $this; } /** * A unique SID identifier of a Subaccount. * * @param string $subaccount A unique SID identifier of a Subaccount. * @return $this Fluent Builder */ public function setSubaccount(string $subaccount): self { $this->options['subaccount'] = $subaccount; return $this; } /** * A boolean flag indicating an abnormal session where the last SIP response was not 200 OK. * * @param bool $abnormalSession A boolean flag indicating an abnormal session where the last SIP response was not 200 OK. * @return $this Fluent Builder */ public function setAbnormalSession(bool $abnormalSession): self { $this->options['abnormalSession'] = $abnormalSession; return $this; } /** * An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`. * * @param string $answeredBy An Answered By value for the calls based on `Answering Machine Detection (AMD)`. One of `unknown`, `machine_start`, `machine_end_beep`, `machine_end_silence`, `machine_end_other`, `human` or `fax`. * @return $this Fluent Builder */ public function setAnsweredBy(string $answeredBy): self { $this->options['answeredBy'] = $answeredBy; return $this; } /** * Either machine or human. * * @param string $answeredByAnnotation Either machine or human. * @return $this Fluent Builder */ public function setAnsweredByAnnotation(string $answeredByAnnotation): self { $this->options['answeredByAnnotation'] = $answeredByAnnotation; return $this; } /** * A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`. * * @param string $connectivityIssueAnnotation A Connectivity Issue with the calls. One of `no_connectivity_issue`, `invalid_number`, `caller_id`, `dropped_call`, or `number_reachability`. * @return $this Fluent Builder */ public function setConnectivityIssueAnnotation(string $connectivityIssueAnnotation): self { $this->options['connectivityIssueAnnotation'] = $connectivityIssueAnnotation; return $this; } /** * A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. * * @param string $qualityIssueAnnotation A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. * @return $this Fluent Builder */ public function setQualityIssueAnnotation(string $qualityIssueAnnotation): self { $this->options['qualityIssueAnnotation'] = $qualityIssueAnnotation; return $this; } /** * A boolean flag indicating spam calls. * * @param bool $spamAnnotation A boolean flag indicating spam calls. * @return $this Fluent Builder */ public function setSpamAnnotation(bool $spamAnnotation): self { $this->options['spamAnnotation'] = $spamAnnotation; return $this; } /** * A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. * * @param string $callScoreAnnotation A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. * @return $this Fluent Builder */ public function setCallScoreAnnotation(string $callScoreAnnotation): self { $this->options['callScoreAnnotation'] = $callScoreAnnotation; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.ReadCallSummariesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/ConferenceOptions.php000064400000020674150364341760016534 0ustar00options['conferenceSid'] = $conferenceSid; $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; $this->options['createdAfter'] = $createdAfter; $this->options['createdBefore'] = $createdBefore; $this->options['mixerRegion'] = $mixerRegion; $this->options['tags'] = $tags; $this->options['subaccount'] = $subaccount; $this->options['detectedIssues'] = $detectedIssues; $this->options['endReason'] = $endReason; } /** * The SID of the conference. * * @param string $conferenceSid The SID of the conference. * @return $this Fluent Builder */ public function setConferenceSid(string $conferenceSid): self { $this->options['conferenceSid'] = $conferenceSid; return $this; } /** * Custom label for the conference resource, up to 64 characters. * * @param string $friendlyName Custom label for the conference resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Conference status. * * @param string $status Conference status. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Conferences created after the provided timestamp specified in ISO 8601 format * * @param string $createdAfter Conferences created after the provided timestamp specified in ISO 8601 format * @return $this Fluent Builder */ public function setCreatedAfter(string $createdAfter): self { $this->options['createdAfter'] = $createdAfter; return $this; } /** * Conferences created before the provided timestamp specified in ISO 8601 format. * * @param string $createdBefore Conferences created before the provided timestamp specified in ISO 8601 format. * @return $this Fluent Builder */ public function setCreatedBefore(string $createdBefore): self { $this->options['createdBefore'] = $createdBefore; return $this; } /** * Twilio region where the conference media was mixed. * * @param string $mixerRegion Twilio region where the conference media was mixed. * @return $this Fluent Builder */ public function setMixerRegion(string $mixerRegion): self { $this->options['mixerRegion'] = $mixerRegion; return $this; } /** * Tags applied by Twilio for common potential configuration, quality, or performance issues. * * @param string $tags Tags applied by Twilio for common potential configuration, quality, or performance issues. * @return $this Fluent Builder */ public function setTags(string $tags): self { $this->options['tags'] = $tags; return $this; } /** * Account SID for the subaccount whose resources you wish to retrieve. * * @param string $subaccount Account SID for the subaccount whose resources you wish to retrieve. * @return $this Fluent Builder */ public function setSubaccount(string $subaccount): self { $this->options['subaccount'] = $subaccount; return $this; } /** * Potential configuration, behavior, or performance issues detected during the conference. * * @param string $detectedIssues Potential configuration, behavior, or performance issues detected during the conference. * @return $this Fluent Builder */ public function setDetectedIssues(string $detectedIssues): self { $this->options['detectedIssues'] = $detectedIssues; return $this; } /** * Conference end reason; e.g. last participant left, modified by API, etc. * * @param string $endReason Conference end reason; e.g. last participant left, modified by API, etc. * @return $this Fluent Builder */ public function setEndReason(string $endReason): self { $this->options['endReason'] = $endReason; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.ReadConferenceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/SettingPage.php000064400000003022150364341760015307 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/CallSummariesList.php000064400000015703150364341760016503 0ustar00solution = [ ]; $this->uri = '/Voice/Summaries'; } /** * Reads CallSummariesInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CallSummariesInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CallSummariesInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CallSummariesInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CallSummariesPage Page of CallSummariesInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CallSummariesPage { $options = new Values($options); $params = Values::of([ 'From' => $options['from'], 'To' => $options['to'], 'FromCarrier' => $options['fromCarrier'], 'ToCarrier' => $options['toCarrier'], 'FromCountryCode' => $options['fromCountryCode'], 'ToCountryCode' => $options['toCountryCode'], 'Branded' => Serialize::booleanToString($options['branded']), 'VerifiedCaller' => Serialize::booleanToString($options['verifiedCaller']), 'HasTag' => Serialize::booleanToString($options['hasTag']), 'StartTime' => $options['startTime'], 'EndTime' => $options['endTime'], 'CallType' => $options['callType'], 'CallState' => $options['callState'], 'Direction' => $options['direction'], 'ProcessingState' => $options['processingState'], 'SortBy' => $options['sortBy'], 'Subaccount' => $options['subaccount'], 'AbnormalSession' => Serialize::booleanToString($options['abnormalSession']), 'AnsweredBy' => $options['answeredBy'], 'AnsweredByAnnotation' => $options['answeredByAnnotation'], 'ConnectivityIssueAnnotation' => $options['connectivityIssueAnnotation'], 'QualityIssueAnnotation' => $options['qualityIssueAnnotation'], 'SpamAnnotation' => Serialize::booleanToString($options['spamAnnotation']), 'CallScoreAnnotation' => $options['callScoreAnnotation'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CallSummariesPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CallSummariesInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CallSummariesPage Page of CallSummariesInstance */ public function getPage(string $targetUrl): CallSummariesPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CallSummariesPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.CallSummariesList]'; } } sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantContext.php000064400000004366150364341760017650 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantInstance.php000064400000012046150364341760017762 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantPage.php000064400000003120150364341760017063 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/Room/ParticipantList.php000064400000012616150364341760017134 0ustar00solution = [ 'roomSid' => $roomSid, ]; $this->uri = '/Video/Rooms/' . \rawurlencode($roomSid) .'/Participants'; } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $participantSid The SID of the Participant resource. */ public function getContext( string $participantSid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['roomSid'], $participantSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Insights/V1/RoomOptions.php000064400000011213150364341760015366 0ustar00options['roomType'] = $roomType; $this->options['codec'] = $codec; $this->options['roomName'] = $roomName; $this->options['createdAfter'] = $createdAfter; $this->options['createdBefore'] = $createdBefore; } /** * Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. * * @param string $roomType Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. * @return $this Fluent Builder */ public function setRoomType(array $roomType): self { $this->options['roomType'] = $roomType; return $this; } /** * Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. * * @param string $codec Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. * @return $this Fluent Builder */ public function setCodec(array $codec): self { $this->options['codec'] = $codec; return $this; } /** * Room friendly name. * * @param string $roomName Room friendly name. * @return $this Fluent Builder */ public function setRoomName(string $roomName): self { $this->options['roomName'] = $roomName; return $this; } /** * Only read rooms that started on or after this ISO 8601 timestamp. * * @param \DateTime $createdAfter Only read rooms that started on or after this ISO 8601 timestamp. * @return $this Fluent Builder */ public function setCreatedAfter(\DateTime $createdAfter): self { $this->options['createdAfter'] = $createdAfter; return $this; } /** * Only read rooms that started before this ISO 8601 timestamp. * * @param \DateTime $createdBefore Only read rooms that started before this ISO 8601 timestamp. * @return $this Fluent Builder */ public function setCreatedBefore(\DateTime $createdBefore): self { $this->options['createdBefore'] = $createdBefore; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.ReadRoomOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantList.php000064400000014130150364341760022250 0ustar00solution = [ 'conferenceSid' => $conferenceSid, ]; $this->uri = '/Conferences/' . \rawurlencode($conferenceSid) .'/Participants'; } /** * Reads ConferenceParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConferenceParticipantInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ConferenceParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConferenceParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConferenceParticipantPage Page of ConferenceParticipantInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConferenceParticipantPage { $options = new Values($options); $params = Values::of([ 'ParticipantSid' => $options['participantSid'], 'Label' => $options['label'], 'Events' => $options['events'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConferenceParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConferenceParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConferenceParticipantPage Page of ConferenceParticipantInstance */ public function getPage(string $targetUrl): ConferenceParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConferenceParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ConferenceParticipantContext * * @param string $participantSid The unique SID identifier of the Participant. */ public function getContext( string $participantSid ): ConferenceParticipantContext { return new ConferenceParticipantContext( $this->version, $this->solution['conferenceSid'], $participantSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.ConferenceParticipantList]'; } } sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php000064400000005323150364341760022765 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantInstance.php000064400000014650150364341760023110 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantOptions.php000064400000012734150364341760023000 0ustar00options['events'] = $events; $this->options['metrics'] = $metrics; } /** * Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. * * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. * @return $this Fluent Builder */ public function setEvents(string $events): self { $this->options['events'] = $events; return $this; } /** * Object. Contains participant call quality metrics. * * @param string $metrics Object. Contains participant call quality metrics. * @return $this Fluent Builder */ public function setMetrics(string $metrics): self { $this->options['metrics'] = $metrics; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.FetchConferenceParticipantOptions ' . $options . ']'; } } class ReadConferenceParticipantOptions extends Options { /** * @param string $participantSid The unique SID identifier of the Participant. * @param string $label User-specified label for a participant. * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. */ public function __construct( string $participantSid = Values::NONE, string $label = Values::NONE, string $events = Values::NONE ) { $this->options['participantSid'] = $participantSid; $this->options['label'] = $label; $this->options['events'] = $events; } /** * The unique SID identifier of the Participant. * * @param string $participantSid The unique SID identifier of the Participant. * @return $this Fluent Builder */ public function setParticipantSid(string $participantSid): self { $this->options['participantSid'] = $participantSid; return $this; } /** * User-specified label for a participant. * * @param string $label User-specified label for a participant. * @return $this Fluent Builder */ public function setLabel(string $label): self { $this->options['label'] = $label; return $this; } /** * Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. * * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. * @return $this Fluent Builder */ public function setEvents(string $events): self { $this->options['events'] = $events; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.ReadConferenceParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantPage.php000064400000003236150364341760022216 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/RoomContext.php000064400000007173150364341760015371 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryInstance.php000064400000012724150364341760017677 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/EventList.php000064400000012342150364341760015672 0ustar00solution = [ 'callSid' => $callSid, ]; $this->uri = '/Voice/' . \rawurlencode($callSid) .'/Events'; } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EventPage Page of EventInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EventPage { $options = new Values($options); $params = Values::of([ 'Edge' => $options['edge'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EventPage Page of EventInstance */ public function getPage(string $targetUrl): EventPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.EventList]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationOptions.php000064400000021700150364341760017441 0ustar00options['answeredBy'] = $answeredBy; $this->options['connectivityIssue'] = $connectivityIssue; $this->options['qualityIssues'] = $qualityIssues; $this->options['spam'] = $spam; $this->options['callScore'] = $callScore; $this->options['comment'] = $comment; $this->options['incident'] = $incident; } /** * @param string $answeredBy * @return $this Fluent Builder */ public function setAnsweredBy(string $answeredBy): self { $this->options['answeredBy'] = $answeredBy; return $this; } /** * @param string $connectivityIssue * @return $this Fluent Builder */ public function setConnectivityIssue(string $connectivityIssue): self { $this->options['connectivityIssue'] = $connectivityIssue; return $this; } /** * Specify if the call had any subjective quality issues. Possible values, one or more of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. Use comma separated values to indicate multiple quality issues for the same call. * * @param string $qualityIssues Specify if the call had any subjective quality issues. Possible values, one or more of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. Use comma separated values to indicate multiple quality issues for the same call. * @return $this Fluent Builder */ public function setQualityIssues(string $qualityIssues): self { $this->options['qualityIssues'] = $qualityIssues; return $this; } /** * A boolean flag to indicate if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Use `true` if the call was a spam call. * * @param bool $spam A boolean flag to indicate if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Use `true` if the call was a spam call. * @return $this Fluent Builder */ public function setSpam(bool $spam): self { $this->options['spam'] = $spam; return $this; } /** * Specify the call score. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. * * @param int $callScore Specify the call score. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. * @return $this Fluent Builder */ public function setCallScore(int $callScore): self { $this->options['callScore'] = $callScore; return $this; } /** * Specify any comments pertaining to the call. `comment` has a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in the `comment`. * * @param string $comment Specify any comments pertaining to the call. `comment` has a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in the `comment`. * @return $this Fluent Builder */ public function setComment(string $comment): self { $this->options['comment'] = $comment; return $this; } /** * Associate this call with an incident or support ticket. The `incident` parameter is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`. * * @param string $incident Associate this call with an incident or support ticket. The `incident` parameter is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`. * @return $this Fluent Builder */ public function setIncident(string $incident): self { $this->options['incident'] = $incident; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.UpdateAnnotationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/MetricOptions.php000064400000005457150364341760016565 0ustar00options['edge'] = $edge; $this->options['direction'] = $direction; } /** * The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. * * @param string $edge The Edge of this Metric. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. * @return $this Fluent Builder */ public function setEdge(string $edge): self { $this->options['edge'] = $edge; return $this; } /** * The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`. * * @param string $direction The Direction of this Metric. One of `unknown`, `inbound`, `outbound` or `both`. * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.ReadMetricOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationContext.php000064400000006217150364341760017440 0ustar00solution = [ 'callSid' => $callSid, ]; $this->uri = '/Voice/' . \rawurlencode($callSid) .'/Annotation'; } /** * Fetch the AnnotationInstance * * @return AnnotationInstance Fetched AnnotationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AnnotationInstance { $payload = $this->version->fetch('GET', $this->uri); return new AnnotationInstance( $this->version, $payload, $this->solution['callSid'] ); } /** * Update the AnnotationInstance * * @param array|Options $options Optional Arguments * @return AnnotationInstance Updated AnnotationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AnnotationInstance { $options = new Values($options); $data = Values::of([ 'AnsweredBy' => $options['answeredBy'], 'ConnectivityIssue' => $options['connectivityIssue'], 'QualityIssues' => $options['qualityIssues'], 'Spam' => Serialize::booleanToString($options['spam']), 'CallScore' => $options['callScore'], 'Comment' => $options['comment'], 'Incident' => $options['incident'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); 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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationPage.php000064400000003112150364341760016657 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/MetricList.php000064400000012465150364341760016042 0ustar00solution = [ 'callSid' => $callSid, ]; $this->uri = '/Voice/' . \rawurlencode($callSid) .'/Metrics'; } /** * Reads MetricInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MetricInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MetricInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MetricInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MetricPage Page of MetricInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MetricPage { $options = new Values($options); $params = Values::of([ 'Edge' => $options['edge'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MetricPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MetricInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MetricPage Page of MetricInstance */ public function getPage(string $targetUrl): MetricPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MetricPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.MetricList]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryOptions.php000064400000004150150364341760017560 0ustar00options['processingState'] = $processingState; } /** * The Processing State of this Call Summary. One of `complete`, `partial` or `all`. * * @param string $processingState The Processing State of this Call Summary. One of `complete`, `partial` or `all`. * @return $this Fluent Builder */ public function setProcessingState(string $processingState): self { $this->options['processingState'] = $processingState; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.FetchCallSummaryOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/EventPage.php000064400000003054150364341760015633 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/MetricPage.php000064400000003062150364341760015774 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/EventOptions.php000064400000004022150364341760016406 0ustar00options['edge'] = $edge; } /** * The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. * * @param string $edge The Edge of this Event. One of `unknown_edge`, `carrier_edge`, `sip_edge`, `sdk_edge` or `client_edge`. * @return $this Fluent Builder */ public function setEdge(string $edge): self { $this->options['edge'] = $edge; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Insights.V1.ReadEventOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationInstance.php000064400000010535150364341760017556 0ustar00properties = [ 'callSid' => Values::array_get($payload, 'call_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'answeredBy' => Values::array_get($payload, 'answered_by'), 'connectivityIssue' => Values::array_get($payload, 'connectivity_issue'), 'qualityIssues' => Values::array_get($payload, 'quality_issues'), 'spam' => Values::array_get($payload, 'spam'), 'callScore' => Values::array_get($payload, 'call_score'), 'comment' => Values::array_get($payload, 'comment'), 'incident' => Values::array_get($payload, 'incident'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['callSid' => $callSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AnnotationContext Context for this AnnotationInstance */ protected function proxy(): AnnotationContext { if (!$this->context) { $this->context = new AnnotationContext( $this->version, $this->solution['callSid'] ); } return $this->context; } /** * Fetch the AnnotationInstance * * @return AnnotationInstance Fetched AnnotationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AnnotationInstance { return $this->proxy()->fetch(); } /** * Update the AnnotationInstance * * @param array|Options $options Optional Arguments * @return AnnotationInstance Updated AnnotationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AnnotationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Insights.V1.AnnotationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/MetricInstance.php000064400000005611150364341760016666 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryPage.php000064400000003120150364341760016775 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php000064400000004432150364341760017554 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/AnnotationList.php000064400000003034150364341760016721 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryList.php000064400000003042150364341760017037 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/EventInstance.php000064400000006061150364341760016524 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Insights/V1/RoomList.php000064400000013245150364341760014655 0ustar00solution = [ ]; $this->uri = '/Video/Rooms'; } /** * Reads RoomInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoomInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RoomInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoomInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RoomPage Page of RoomInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RoomPage { $options = new Values($options); $params = Values::of([ 'RoomType' => $options['roomType'], 'Codec' => $options['codec'], 'RoomName' => $options['roomName'], 'CreatedAfter' => Serialize::iso8601DateTime($options['createdAfter']), 'CreatedBefore' => Serialize::iso8601DateTime($options['createdBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RoomPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoomInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RoomPage Page of RoomInstance */ public function getPage(string $targetUrl): RoomPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RoomPage($this->version, $response, $this->solution); } /** * Constructs a RoomContext * * @param string $roomSid The SID of the Room resource. */ public function getContext( string $roomSid ): RoomContext { return new RoomContext( $this->version, $roomSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights.V1.RoomList]'; } } sdk/src/Twilio/Rest/Insights/V1/SettingInstance.php000064400000007204150364341760016205 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1.php000064400000007117150364341760013113 0ustar00version = 'v1'; } protected function getCommands(): CommandList { if (!$this->_commands) { $this->_commands = new CommandList($this); } return $this->_commands; } protected function getRatePlans(): RatePlanList { if (!$this->_ratePlans) { $this->_ratePlans = new RatePlanList($this); } return $this->_ratePlans; } protected function getSims(): SimList { if (!$this->_sims) { $this->_sims = new SimList($this); } return $this->_sims; } protected function getUsageRecords(): UsageRecordList { if (!$this->_usageRecords) { $this->_usageRecords = new UsageRecordList($this); } return $this->_usageRecords; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanOptions.php000064400000041777150364341760016207 0ustar00options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['dataMetering'] = $dataMetering; $this->options['messagingEnabled'] = $messagingEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; $this->options['internationalRoaming'] = $internationalRoaming; $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A descriptive string that you create to describe the resource. It does not have to be unique. * * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether SIMs can use GPRS/3G/4G/LTE data connectivity. * * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data connectivity. * @return $this Fluent Builder */ public function setDataEnabled(bool $dataEnabled): self { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. * * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). * * @param string $dataMetering The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). * @return $this Fluent Builder */ public function setDataMetering(string $dataMetering): self { $this->options['dataMetering'] = $dataMetering; return $this; } /** * Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). * * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @return $this Fluent Builder */ public function setMessagingEnabled(bool $messagingEnabled): self { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * Deprecated. * * @param bool $voiceEnabled Deprecated. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). * * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). * @return $this Fluent Builder */ public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self { $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; return $this; } /** * The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. * * @param string[] $internationalRoaming The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. * @return $this Fluent Builder */ public function setInternationalRoaming(array $internationalRoaming): self { $this->options['internationalRoaming'] = $internationalRoaming; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. * * @param int $nationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. * @return $this Fluent Builder */ public function setNationalRoamingDataLimit(int $nationalRoamingDataLimit): self { $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. * * @param int $internationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. * @return $this Fluent Builder */ public function setInternationalRoamingDataLimit(int $internationalRoamingDataLimit): self { $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.CreateRatePlanOptions ' . $options . ']'; } } class UpdateRatePlanOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. */ public function __construct( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A descriptive string that you create to describe the resource. It does not have to be unique. * * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.UpdateRatePlanOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandContext.php000064400000004334150364341760016034 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Commands/' . \rawurlencode($sid) .''; } /** * Delete the CommandInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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.Wireless.V1.CommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/SimList.php000064400000013105150364341760014471 0ustar00solution = [ ]; $this->uri = '/Sims'; } /** * Reads SimInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SimPage Page of SimInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SimPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'Iccid' => $options['iccid'], 'RatePlan' => $options['ratePlan'], 'EId' => $options['eId'], 'SimRegistrationCode' => $options['simRegistrationCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SimPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SimPage Page of SimInstance */ public function getPage(string $targetUrl): SimPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimPage($this->version, $response, $this->solution); } /** * Constructs a SimContext * * @param string $sid The SID or the `unique_name` of the Sim resource to delete. */ public function getContext( string $sid ): SimContext { return new SimContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.SimList]'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordPage.php000064400000003052150364341760016105 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return UsageRecordInstance \Twilio\Rest\Wireless\V1\UsageRecordInstance */ public function buildInstance(array $payload): UsageRecordInstance { return new UsageRecordInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanInstance.php000064400000013001150364341760016273 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dataEnabled' => Values::array_get($payload, 'data_enabled'), 'dataMetering' => Values::array_get($payload, 'data_metering'), 'dataLimit' => Values::array_get($payload, 'data_limit'), 'messagingEnabled' => Values::array_get($payload, 'messaging_enabled'), 'voiceEnabled' => Values::array_get($payload, 'voice_enabled'), 'nationalRoamingEnabled' => Values::array_get($payload, 'national_roaming_enabled'), 'nationalRoamingDataLimit' => Values::array_get($payload, 'national_roaming_data_limit'), 'internationalRoaming' => Values::array_get($payload, 'international_roaming'), 'internationalRoamingDataLimit' => Values::array_get($payload, 'international_roaming_data_limit'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RatePlanContext Context for this RatePlanInstance */ protected function proxy(): RatePlanContext { if (!$this->context) { $this->context = new RatePlanContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RatePlanInstance { return $this->proxy()->fetch(); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RatePlanInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.RatePlanInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/SimInstance.php000064400000015215150364341760015326 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'ratePlanSid' => Values::array_get($payload, 'rate_plan_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'iccid' => Values::array_get($payload, 'iccid'), 'eId' => Values::array_get($payload, 'e_id'), 'status' => Values::array_get($payload, 'status'), 'resetStatus' => Values::array_get($payload, 'reset_status'), 'commandsCallbackUrl' => Values::array_get($payload, 'commands_callback_url'), 'commandsCallbackMethod' => Values::array_get($payload, 'commands_callback_method'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'ipAddress' => Values::array_get($payload, 'ip_address'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SimContext Context for this SimInstance */ protected function proxy(): SimContext { if (!$this->context) { $this->context = new SimContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SimInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SimInstance { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SimInstance { return $this->proxy()->update($options); } /** * Access the dataSessions */ protected function getDataSessions(): DataSessionList { return $this->proxy()->dataSessions; } /** * Access the usageRecords */ protected function getUsageRecords(): UsageRecordList { return $this->proxy()->usageRecords; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.SimInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordList.php000064400000012520150364341760016144 0ustar00solution = [ ]; $this->uri = '/UsageRecords'; } /** * Reads UsageRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsageRecordInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UsageRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UsageRecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UsageRecordPage Page of UsageRecordInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UsageRecordPage { $options = new Values($options); $params = Values::of([ 'End' => Serialize::iso8601DateTime($options['end']), 'Start' => Serialize::iso8601DateTime($options['start']), 'Granularity' => $options['granularity'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsageRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UsageRecordPage Page of UsageRecordInstance */ public function getPage(string $targetUrl): UsageRecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordList]'; } } sdk/src/Twilio/Rest/Wireless/V1/SimPage.php000064400000002772150364341760014442 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SimInstance \Twilio\Rest\Wireless\V1\SimInstance */ public function buildInstance(array $payload): SimInstance { return new SimInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.SimPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanContext.php000064400000005764150364341760016174 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/RatePlans/' . \rawurlencode($sid) .''; } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.RatePlanContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandList.php000064400000015506150364341760015326 0ustar00solution = [ ]; $this->uri = '/Commands'; } /** * Create the CommandInstance * * @param string $command The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode. * @param array|Options $options Optional Arguments * @return CommandInstance Created CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $command, array $options = []): CommandInstance { $options = new Values($options); $data = Values::of([ 'Command' => $command, 'Sim' => $options['sim'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'CommandMode' => $options['commandMode'], 'IncludeSid' => $options['includeSid'], 'DeliveryReceiptRequested' => Serialize::booleanToString($options['deliveryReceiptRequested']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CommandInstance( $this->version, $payload ); } /** * Reads CommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CommandInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CommandInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CommandPage Page of CommandInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CommandPage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'Transport' => $options['transport'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CommandPage Page of CommandInstance */ public function getPage(string $targetUrl): CommandPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CommandPage($this->version, $response, $this->solution); } /** * Constructs a CommandContext * * @param string $sid The SID of the Command resource to delete. */ public function getContext( string $sid ): CommandContext { return new CommandContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.CommandList]'; } } sdk/src/Twilio/Rest/Wireless/V1/SimContext.php000064400000014200150364341760015177 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Sims/' . \rawurlencode($sid) .''; } /** * Delete the SimInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'], 'ResetStatus' => $options['resetStatus'], 'AccountSid' => $options['accountSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SimInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the dataSessions */ protected function getDataSessions(): DataSessionList { if (!$this->_dataSessions) { $this->_dataSessions = new DataSessionList( $this->version, $this->solution['sid'] ); } return $this->_dataSessions; } /** * Access the usageRecords */ protected function getUsageRecords(): UsageRecordList { if (!$this->_usageRecords) { $this->_usageRecords = new UsageRecordList( $this->version, $this->solution['sid'] ); } return $this->_usageRecords; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.SimContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanList.php000064400000015346150364341760015460 0ustar00solution = [ ]; $this->uri = '/RatePlans'; } /** * Create the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Created RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): RatePlanInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], 'DataEnabled' => Serialize::booleanToString($options['dataEnabled']), 'DataLimit' => $options['dataLimit'], 'DataMetering' => $options['dataMetering'], 'MessagingEnabled' => Serialize::booleanToString($options['messagingEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'NationalRoamingEnabled' => Serialize::booleanToString($options['nationalRoamingEnabled']), 'InternationalRoaming' => Serialize::map($options['internationalRoaming'], function ($e) { return $e; }), 'NationalRoamingDataLimit' => $options['nationalRoamingDataLimit'], 'InternationalRoamingDataLimit' => $options['internationalRoamingDataLimit'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RatePlanInstance( $this->version, $payload ); } /** * Reads RatePlanInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RatePlanInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RatePlanInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RatePlanInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RatePlanPage Page of RatePlanInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RatePlanPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RatePlanPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RatePlanInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RatePlanPage Page of RatePlanInstance */ public function getPage(string $targetUrl): RatePlanPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RatePlanPage($this->version, $response, $this->solution); } /** * Constructs a RatePlanContext * * @param string $sid The SID of the RatePlan resource to delete. */ public function getContext( string $sid ): RatePlanContext { return new RatePlanContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.RatePlanList]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanPage.php000064400000003030150364341760015404 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return RatePlanInstance \Twilio\Rest\Wireless\V1\RatePlanInstance */ public function buildInstance(array $payload): RatePlanInstance { return new RatePlanInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.RatePlanPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandOptions.php000064400000031340150364341760016040 0ustar00options['sim'] = $sim; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['commandMode'] = $commandMode; $this->options['includeSid'] = $includeSid; $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; } /** * The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. * * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. * * @param string $callbackMethod The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. * * @param string $callbackUrl The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * @param string $commandMode * @return $this Fluent Builder */ public function setCommandMode(string $commandMode): self { $this->options['commandMode'] = $commandMode; return $this; } /** * Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. * * @param string $includeSid Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. * @return $this Fluent Builder */ public function setIncludeSid(string $includeSid): self { $this->options['includeSid'] = $includeSid; return $this; } /** * Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. * * @param bool $deliveryReceiptRequested Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. * @return $this Fluent Builder */ public function setDeliveryReceiptRequested(bool $deliveryReceiptRequested): self { $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.CreateCommandOptions ' . $options . ']'; } } class ReadCommandOptions extends Options { /** * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. * @param string $direction Only return Commands with this direction value. * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. */ public function __construct( string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE, string $transport = Values::NONE ) { $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; $this->options['transport'] = $transport; } /** * The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. * * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. * * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Only return Commands with this direction value. * * @param string $direction Only return Commands with this direction value. * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Only return Commands with this transport value. Can be: `sms` or `ip`. * * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. * @return $this Fluent Builder */ public function setTransport(string $transport): self { $this->options['transport'] = $transport; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.ReadCommandOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandPage.php000064400000003022150364341760015255 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return CommandInstance \Twilio\Rest\Wireless\V1\CommandInstance */ public function buildInstance(array $payload): CommandInstance { return new CommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.CommandPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordInstance.php000064400000004434150364341760017002 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'period' => Values::array_get($payload, 'period'), 'commands' => Values::array_get($payload, 'commands'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php000064400000003115150364341760016647 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return DataSessionInstance \Twilio\Rest\Wireless\V1\Sim\DataSessionInstance */ public function buildInstance(array $payload): DataSessionInstance { return new DataSessionInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.DataSessionPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php000064400000003115150364341760016635 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return UsageRecordInstance \Twilio\Rest\Wireless\V1\Sim\UsageRecordInstance */ public function buildInstance(array $payload): UsageRecordInstance { return new UsageRecordInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php000064400000013130150364341760016672 0ustar00solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/UsageRecords'; } /** * Reads UsageRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsageRecordInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UsageRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UsageRecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UsageRecordPage Page of UsageRecordInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UsageRecordPage { $options = new Values($options); $params = Values::of([ 'End' => Serialize::iso8601DateTime($options['end']), 'Start' => Serialize::iso8601DateTime($options['start']), 'Granularity' => $options['granularity'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsageRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UsageRecordPage Page of UsageRecordInstance */ public function getPage(string $targetUrl): UsageRecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordList]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php000064400000012123150364341760016705 0ustar00solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/DataSessions'; } /** * Reads DataSessionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DataSessionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DataSessionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DataSessionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DataSessionPage Page of DataSessionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DataSessionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DataSessionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DataSessionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DataSessionPage Page of DataSessionInstance */ public function getPage(string $targetUrl): DataSessionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DataSessionPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.DataSessionList]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php000064400000007567150364341760017556 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'radioLink' => Values::array_get($payload, 'radio_link'), 'operatorMcc' => Values::array_get($payload, 'operator_mcc'), 'operatorMnc' => Values::array_get($payload, 'operator_mnc'), 'operatorCountry' => Values::array_get($payload, 'operator_country'), 'operatorName' => Values::array_get($payload, 'operator_name'), 'cellId' => Values::array_get($payload, 'cell_id'), 'cellLocationEstimate' => Values::array_get($payload, 'cell_location_estimate'), 'packetsUploaded' => Values::array_get($payload, 'packets_uploaded'), 'packetsDownloaded' => Values::array_get($payload, 'packets_downloaded'), 'lastUpdated' => Deserialize::dateTime(Values::array_get($payload, 'last_updated')), 'start' => Deserialize::dateTime(Values::array_get($payload, 'start')), 'end' => Deserialize::dateTime(Values::array_get($payload, 'end')), 'imei' => Values::array_get($payload, 'imei'), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.DataSessionInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php000064400000005065150364341760017533 0ustar00properties = [ 'simSid' => Values::array_get($payload, 'sim_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'period' => Values::array_get($payload, 'period'), 'commands' => Values::array_get($payload, 'commands'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php000064400000011303150364341760017412 0ustar00options['end'] = $end; $this->options['start'] = $start; $this->options['granularity'] = $granularity; } /** * Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. * * @param \DateTime $end Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. * @return $this Fluent Builder */ public function setEnd(\DateTime $end): self { $this->options['end'] = $end; return $this; } /** * Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. * * @param \DateTime $start Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. * @return $this Fluent Builder */ public function setStart(\DateTime $start): self { $this->options['start'] = $start; return $this; } /** * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * @return $this Fluent Builder */ public function setGranularity(string $granularity): self { $this->options['granularity'] = $granularity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.ReadUsageRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordOptions.php000064400000010357150364341760016672 0ustar00options['end'] = $end; $this->options['start'] = $start; $this->options['granularity'] = $granularity; } /** * Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * * @param \DateTime $end Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * @return $this Fluent Builder */ public function setEnd(\DateTime $end): self { $this->options['end'] = $end; return $this; } /** * Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * * @param \DateTime $start Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * @return $this Fluent Builder */ public function setStart(\DateTime $start): self { $this->options['start'] = $start; return $this; } /** * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * @return $this Fluent Builder */ public function setGranularity(string $granularity): self { $this->options['granularity'] = $granularity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.ReadUsageRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/SimOptions.php000064400000056663150364341760015231 0ustar00options['status'] = $status; $this->options['iccid'] = $iccid; $this->options['ratePlan'] = $ratePlan; $this->options['eId'] = $eId; $this->options['simRegistrationCode'] = $simRegistrationCode; } /** * Only return Sim resources with this status. * * @param string $status Only return Sim resources with this status. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. * * @param string $iccid Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. * @return $this Fluent Builder */ public function setIccid(string $iccid): self { $this->options['iccid'] = $iccid; return $this; } /** * The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. * * @param string $ratePlan The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * Deprecated. * * @param string $eId Deprecated. * @return $this Fluent Builder */ public function setEId(string $eId): self { $this->options['eId'] = $eId; return $this; } /** * Only return Sim resources with this registration code. This will return a list with a maximum size of 1. * * @param string $simRegistrationCode Only return Sim resources with this registration code. This will return a list with a maximum size of 1. * @return $this Fluent Builder */ public function setSimRegistrationCode(string $simRegistrationCode): self { $this->options['simRegistrationCode'] = $simRegistrationCode; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.ReadSimOptions ' . $options . ']'; } } class UpdateSimOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. * @param string $status * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @param string $voiceFallbackMethod Deprecated. * @param string $voiceFallbackUrl Deprecated. * @param string $voiceMethod Deprecated. * @param string $voiceUrl Deprecated. * @param string $resetStatus * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). */ public function __construct( string $uniqueName = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE, string $ratePlan = Values::NONE, string $status = Values::NONE, string $commandsCallbackMethod = Values::NONE, string $commandsCallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $resetStatus = Values::NONE, string $accountSid = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; $this->options['ratePlan'] = $ratePlan; $this->options['status'] = $status; $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['resetStatus'] = $resetStatus; $this->options['accountSid'] = $accountSid; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). * * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * A descriptive string that you create to describe the Sim resource. It does not need to be unique. * * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. * * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. * * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @return $this Fluent Builder */ public function setCommandsCallbackMethod(string $commandsCallbackMethod): self { $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; return $this; } /** * The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. * * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. * @return $this Fluent Builder */ public function setCommandsCallbackUrl(string $commandsCallbackUrl): self { $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. * * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. * * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. * * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). * * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * Deprecated. * * @param string $voiceFallbackMethod Deprecated. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * Deprecated. * * @param string $voiceFallbackUrl Deprecated. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * Deprecated. * * @param string $voiceMethod Deprecated. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * Deprecated. * * @param string $voiceUrl Deprecated. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * @param string $resetStatus * @return $this Fluent Builder */ public function setResetStatus(string $resetStatus): self { $this->options['resetStatus'] = $resetStatus; return $this; } /** * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). * * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.UpdateSimOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandInstance.php000064400000010764150364341760016160 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'command' => Values::array_get($payload, 'command'), 'commandMode' => Values::array_get($payload, 'command_mode'), 'transport' => Values::array_get($payload, 'transport'), 'deliveryReceiptRequested' => Values::array_get($payload, 'delivery_receipt_requested'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CommandContext Context for this CommandInstance */ protected function proxy(): CommandContext { if (!$this->context) { $this->context = new CommandContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CommandInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CommandInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.CommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers.php000064400000000640150364341760012435 0ustar00regulatoryCompliance instead. */ protected function getRegulatoryCompliance(): \Twilio\Rest\Numbers\V2\RegulatoryComplianceList { echo "regulatoryCompliance is deprecated. Use v2->regulatoryCompliance instead."; return $this->v2->regulatoryCompliance; } }sdk/src/Twilio/Rest/Conversations.php000064400000011677150364341760013673 0ustar00configuration instead. */ protected function getConfiguration(): \Twilio\Rest\Conversations\V1\ConfigurationList { echo "configuration is deprecated. Use v1->configuration instead."; return $this->v1->configuration; } /** * @deprecated Use v1->configuration() instead. */ protected function contextConfiguration(): \Twilio\Rest\Conversations\V1\ConfigurationContext { echo "configuration() is deprecated. Use v1->configuration() instead."; return $this->v1->configuration(); } /** * @deprecated Use v1->addressConfigurations instead. */ protected function getAddressConfigurations(): \Twilio\Rest\Conversations\V1\AddressConfigurationList { echo "addressConfigurations is deprecated. Use v1->addressConfigurations instead."; return $this->v1->addressConfigurations; } /** * @deprecated Use v1->addressConfigurations(\$sid) instead. * @param string $sid The SID or Address of the Configuration. */ protected function contextAddressConfigurations(string $sid): \Twilio\Rest\Conversations\V1\AddressConfigurationContext { echo "addressConfigurations(\$sid) is deprecated. Use v1->addressConfigurations(\$sid) instead."; return $this->v1->addressConfigurations($sid); } /** * @deprecated Use v1->conversations instead. */ protected function getConversations(): \Twilio\Rest\Conversations\V1\ConversationList { echo "conversations is deprecated. Use v1->conversations instead."; return $this->v1->conversations; } /** * @deprecated Use v1->conversations(\$sid) instead. * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextConversations(string $sid): \Twilio\Rest\Conversations\V1\ConversationContext { echo "conversations(\$sid) is deprecated. Use v1->conversations(\$sid) instead."; return $this->v1->conversations($sid); } /** * @deprecated Use v1->credentials instead. */ protected function getCredentials(): \Twilio\Rest\Conversations\V1\CredentialList { echo "credentials is deprecated. Use v1->credentials instead."; return $this->v1->credentials; } /** * @deprecated Use v1->credentials(\$sid) instead. * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextCredentials(string $sid): \Twilio\Rest\Conversations\V1\CredentialContext { echo "credentials(\$sid) is deprecated. Use v1->credentials(\$sid) instead."; return $this->v1->credentials($sid); } /** * @deprecated Use v1->participantConversations instead. */ protected function getParticipantConversations(): \Twilio\Rest\Conversations\V1\ParticipantConversationList { echo "participantConversations is deprecated. Use v1->participantConversations instead."; return $this->v1->participantConversations; } /** * @deprecated Use v1->roles instead. */ protected function getRoles(): \Twilio\Rest\Conversations\V1\RoleList { echo "roles is deprecated. Use v1->roles instead."; return $this->v1->roles; } /** * @deprecated Use v1->roles(\$sid) instead. * @param string $sid The SID of the Role resource to fetch */ protected function contextRoles(string $sid): \Twilio\Rest\Conversations\V1\RoleContext { echo "roles(\$sid) is deprecated. Use v1->roles(\$sid) instead."; return $this->v1->roles($sid); } /** * @deprecated Use v1->services instead. */ protected function getServices(): \Twilio\Rest\Conversations\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextServices(string $sid): \Twilio\Rest\Conversations\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } /** * @deprecated Use v1->users instead. */ protected function getUsers(): \Twilio\Rest\Conversations\V1\UserList { echo "users is deprecated. Use v1->users instead."; return $this->v1->users; } /** * @deprecated Use v1->users(\$sid) instead. * @param string $sid The SID of the User resource to fetch */ protected function contextUsers(string $sid): \Twilio\Rest\Conversations\V1\UserContext { echo "users(\$sid) is deprecated. Use v1->users(\$sid) instead."; return $this->v1->users($sid); } }sdk/src/Twilio/Rest/AutopilotBase.php000064400000004547150364341760013607 0ustar00baseUrl = '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); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Autopilot]'; } } sdk/src/Twilio/Rest/FrontlineApi/V1.php000064400000005062150364341760013705 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserContext.php000064400000005636150364341760016177 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserOptions.php000064400000010607150364341760016200 0ustar00options['friendlyName'] = $friendlyName; $this->options['avatar'] = $avatar; $this->options['state'] = $state; $this->options['isAvailable'] = $isAvailable; } /** * The string that you assigned to describe the User. * * @param string $friendlyName The string that you assigned to describe the User. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The avatar URL which will be shown in Frontline application. * * @param string $avatar The avatar URL which will be shown in Frontline application. * @return $this Fluent Builder */ public function setAvatar(string $avatar): self { $this->options['avatar'] = $avatar; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). * * @param bool $isAvailable Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). * @return $this Fluent Builder */ public function setIsAvailable(bool $isAvailable): self { $this->options['isAvailable'] = $isAvailable; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FrontlineApi.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserPage.php000064400000003015150364341760015414 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserInstance.php000064400000010012150364341760016277 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserList.php000064400000003004150364341760015451 0ustar00solution = [ ]; } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FrontlineApi.V1.UserList]'; } } sdk/src/Twilio/Rest/VoiceBase.php000064400000004513150364341760012665 0ustar00baseUrl = 'https://voice.twilio.com'; } /** * @return V1 Version v1 of voice */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice]'; } } sdk/src/Twilio/Rest/Numbers/V1.php000064400000007324150364341760012731 0ustar00version = 'v1'; } protected function getBulkEligibilities(): BulkEligibilityList { if (!$this->_bulkEligibilities) { $this->_bulkEligibilities = new BulkEligibilityList($this); } return $this->_bulkEligibilities; } protected function getPortingBulkPortabilities(): PortingBulkPortabilityList { if (!$this->_portingBulkPortabilities) { $this->_portingBulkPortabilities = new PortingBulkPortabilityList($this); } return $this->_portingBulkPortabilities; } protected function getPortingPortabilities(): PortingPortabilityList { if (!$this->_portingPortabilities) { $this->_portingPortabilities = new PortingPortabilityList($this); } return $this->_portingPortabilities; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V1]'; } } sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderInstance.php000064400000010522150364341760020622 0ustar00properties = [ 'bulkHostingSid' => Values::array_get($payload, 'bulk_hosting_sid'), 'requestStatus' => Values::array_get($payload, 'request_status'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'notificationEmail' => Values::array_get($payload, 'notification_email'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'url' => Values::array_get($payload, 'url'), 'totalCount' => Values::array_get($payload, 'total_count'), 'results' => Values::array_get($payload, 'results'), ]; $this->solution = ['bulkHostingSid' => $bulkHostingSid ?: $this->properties['bulkHostingSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BulkHostedNumberOrderContext Context for this BulkHostedNumberOrderInstance */ protected function proxy(): BulkHostedNumberOrderContext { if (!$this->context) { $this->context = new BulkHostedNumberOrderContext( $this->version, $this->solution['bulkHostingSid'] ); } return $this->context; } /** * Fetch the BulkHostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return BulkHostedNumberOrderInstance Fetched BulkHostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): BulkHostedNumberOrderInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.BulkHostedNumberOrderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliancePage.php000064400000003134150364341760017652 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderInstance.php000064400000013137150364341760020011 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'url' => Values::array_get($payload, 'url'), 'contactTitle' => Values::array_get($payload, 'contact_title'), 'contactPhoneNumber' => Values::array_get($payload, 'contact_phone_number'), 'bulkHostingRequestSid' => Values::array_get($payload, 'bulk_hosting_request_sid'), 'nextStep' => Values::array_get($payload, 'next_step'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return HostedNumberOrderContext Context for this HostedNumberOrderInstance */ protected function proxy(): HostedNumberOrderContext { if (!$this->context) { $this->context = new HostedNumberOrderContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the HostedNumberOrderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the HostedNumberOrderInstance * * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): HostedNumberOrderInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.HostedNumberOrderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentContext.php000064400000010252150364341760020630 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/HostedNumber/AuthorizationDocuments/' . \rawurlencode($sid) .''; } /** * Delete the AuthorizationDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the dependentHostedNumberOrders */ protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList { if (!$this->_dependentHostedNumberOrders) { $this->_dependentHostedNumberOrders = new DependentHostedNumberOrderList( $this->version, $this->solution['sid'] ); } return $this->_dependentHostedNumberOrders; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.AuthorizationDocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderOptions.php000064400000044606150364341760017705 0ustar00options['accountSid'] = $accountSid; $this->options['friendlyName'] = $friendlyName; $this->options['ccEmails'] = $ccEmails; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsCapability'] = $smsCapability; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['contactTitle'] = $contactTitle; } /** * This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * * @param string $accountSid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * A 128 character string that is a human readable text that describes this resource. * * @param string $friendlyName A 128 character string that is a human readable text that describes this resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * * @param string[] $ccEmails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsUrl The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsMethod The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsFallbackUrl A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * Used to specify that the SMS capability will be hosted on Twilio's platform. * * @param bool $smsCapability Used to specify that the SMS capability will be hosted on Twilio's platform. * @return $this Fluent Builder */ public function setSmsCapability(bool $smsCapability): self { $this->options['smsCapability'] = $smsCapability; return $this; } /** * The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsFallbackMethod The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * * @param string $statusCallbackUrl Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setStatusCallbackUrl(string $statusCallbackUrl): self { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * * @param string $statusCallbackMethod Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * * @param string $smsApplicationSid Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The title of the person authorized to sign the Authorization Document for this phone number. * * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @return $this Fluent Builder */ public function setContactTitle(string $contactTitle): self { $this->options['contactTitle'] = $contactTitle; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.CreateHostedNumberOrderOptions ' . $options . ']'; } } class ReadHostedNumberOrderOptions extends Options { /** * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * @param bool $smsCapability Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @param string $friendlyName A human readable description of this resource, up to 128 characters. */ public function __construct( string $status = Values::NONE, bool $smsCapability = Values::BOOL_NONE, string $phoneNumber = Values::NONE, string $incomingPhoneNumberSid = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['status'] = $status; $this->options['smsCapability'] = $smsCapability; $this->options['phoneNumber'] = $phoneNumber; $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; $this->options['friendlyName'] = $friendlyName; } /** * The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. * * @param bool $smsCapability Whether the SMS capability will be hosted on our platform. Can be `true` of `false`. * @return $this Fluent Builder */ public function setSmsCapability(bool $smsCapability): self { $this->options['smsCapability'] = $smsCapability; return $this; } /** * An E164 formatted phone number hosted by this HostedNumberOrder. * * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @return $this Fluent Builder */ public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self { $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; return $this; } /** * A human readable description of this resource, up to 128 characters. * * @param string $friendlyName A human readable description of this resource, up to 128 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.ReadHostedNumberOrderOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentList.php000064400000017037150364341760020127 0ustar00solution = [ ]; $this->uri = '/HostedNumber/AuthorizationDocuments'; } /** * Create the AuthorizationDocumentInstance * * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Created AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $addressSid, string $email, string $contactPhoneNumber, array $hostedNumberOrderSids, array $options = []): AuthorizationDocumentInstance { $options = new Values($options); $data = Values::of([ 'AddressSid' => $addressSid, 'Email' => $email, 'ContactPhoneNumber' => $contactPhoneNumber, 'HostedNumberOrderSids' => Serialize::map($hostedNumberOrderSids,function ($e) { return $e; }), 'ContactTitle' => $options['contactTitle'], 'CcEmails' => Serialize::map($options['ccEmails'], function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthorizationDocumentInstance( $this->version, $payload ); } /** * Reads AuthorizationDocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthorizationDocumentInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AuthorizationDocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthorizationDocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthorizationDocumentPage Page of AuthorizationDocumentInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthorizationDocumentPage { $options = new Values($options); $params = Values::of([ 'Email' => $options['email'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthorizationDocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthorizationDocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthorizationDocumentPage Page of AuthorizationDocumentInstance */ public function getPage(string $targetUrl): AuthorizationDocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthorizationDocumentPage($this->version, $response, $this->solution); } /** * Constructs a AuthorizationDocumentContext * * @param string $sid A 34 character string that uniquely identifies this AuthorizationDocument. */ public function getContext( string $sid ): AuthorizationDocumentContext { return new AuthorizationDocumentContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.AuthorizationDocumentList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryComplianceInstance.php000064400000003505150364341760020544 0ustar00solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \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]'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderList.php000064400000013731150364341760025346 0ustar00solution = [ 'signingDocumentSid' => $signingDocumentSid, ]; $this->uri = '/HostedNumber/AuthorizationDocuments/' . \rawurlencode($signingDocumentSid) .'/DependentHostedNumberOrders'; } /** * Reads DependentHostedNumberOrderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DependentHostedNumberOrderInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams DependentHostedNumberOrderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DependentHostedNumberOrderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DependentHostedNumberOrderPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'PhoneNumber' => $options['phoneNumber'], 'IncomingPhoneNumberSid' => $options['incomingPhoneNumberSid'], 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DependentHostedNumberOrderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance */ public function getPage(string $targetUrl): DependentHostedNumberOrderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.DependentHostedNumberOrderList]'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderInstance.php000064400000010536150364341760026177 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'bulkHostingRequestSid' => Values::array_get($payload, 'bulk_hosting_request_sid'), 'nextStep' => Values::array_get($payload, 'next_step'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'contactTitle' => Values::array_get($payload, 'contact_title'), 'contactPhoneNumber' => Values::array_get($payload, 'contact_phone_number'), ]; $this->solution = ['signingDocumentSid' => $signingDocumentSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.DependentHostedNumberOrderInstance]'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderPage.php000064400000003323150364341760025303 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return DependentHostedNumberOrderInstance \Twilio\Rest\Numbers\V2\AuthorizationDocument\DependentHostedNumberOrderInstance */ public function buildInstance(array $payload): DependentHostedNumberOrderInstance { return new DependentHostedNumberOrderInstance($this->version, $payload, $this->solution['signingDocumentSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.DependentHostedNumberOrderPage]'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocument/DependentHostedNumberOrderOptions.php000064400000013177150364341760026072 0ustar00options['status'] = $status; $this->options['phoneNumber'] = $phoneNumber; $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; $this->options['friendlyName'] = $friendlyName; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * An E164 formatted phone number hosted by this HostedNumberOrder. * * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @return $this Fluent Builder */ public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self { $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; return $this; } /** * A human readable description of this resource, up to 128 characters. * * @param string $friendlyName A human readable description of this resource, up to 128 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.ReadDependentHostedNumberOrderOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentInstance.php000064400000011254150364341760020753 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'status' => Values::array_get($payload, 'status'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthorizationDocumentContext Context for this AuthorizationDocumentInstance */ protected function proxy(): AuthorizationDocumentContext { if (!$this->context) { $this->context = new AuthorizationDocumentContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the AuthorizationDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AuthorizationDocumentInstance * * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthorizationDocumentInstance { return $this->proxy()->fetch(); } /** * Access the dependentHostedNumberOrders */ protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList { return $this->proxy()->dependentHostedNumberOrders; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.AuthorizationDocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderPage.php000064400000003142150364341760017732 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return BulkHostedNumberOrderInstance \Twilio\Rest\Numbers\V2\BulkHostedNumberOrderInstance */ public function buildInstance(array $payload): BulkHostedNumberOrderInstance { return new BulkHostedNumberOrderInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.BulkHostedNumberOrderPage]'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentOptions.php000064400000014127150364341760020644 0ustar00options['contactTitle'] = $contactTitle; $this->options['ccEmails'] = $ccEmails; } /** * The title of the person authorized to sign the Authorization Document for this phone number. * * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @return $this Fluent Builder */ public function setContactTitle(string $contactTitle): self { $this->options['contactTitle'] = $contactTitle; return $this; } /** * Email recipients who will be informed when an Authorization Document has been sent and signed. * * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.CreateAuthorizationDocumentOptions ' . $options . ']'; } } class ReadAuthorizationDocumentOptions extends Options { /** * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ public function __construct( string $email = Values::NONE, string $status = Values::NONE ) { $this->options['email'] = $email; $this->options['status'] = $status; } /** * Email that this AuthorizationDocument will be sent to for signing. * * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.ReadAuthorizationDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderContext.php000064400000004532150364341760017670 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/HostedNumber/Orders/' . \rawurlencode($sid) .''; } /** * Delete the HostedNumberOrderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.HostedNumberOrderContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderContext.php000064400000004663150364341760020513 0ustar00solution = [ 'bulkHostingSid' => $bulkHostingSid, ]; $this->uri = '/HostedNumber/Orders/Bulk/' . \rawurlencode($bulkHostingSid) .''; } /** * Fetch the BulkHostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return BulkHostedNumberOrderInstance Fetched BulkHostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): BulkHostedNumberOrderInstance { $options = new Values($options); $params = Values::of([ 'OrderStatus' => $options['orderStatus'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new BulkHostedNumberOrderInstance( $this->version, $payload, $this->solution['bulkHostingSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.BulkHostedNumberOrderContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.php000064400000005434150364341760020517 0ustar00options['orderStatus'] = $orderStatus; } /** * Order status can be used for filtering on Hosted Number Order status values. To see a complete list of order statuses, please check 'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values'. * * @param string $orderStatus Order status can be used for filtering on Hosted Number Order status values. To see a complete list of order statuses, please check 'https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/hosted-number-order-resource#status-values'. * @return $this Fluent Builder */ public function setOrderStatus(string $orderStatus): self { $this->options['orderStatus'] = $orderStatus; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.FetchBulkHostedNumberOrderOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderList.php000064400000020516150364341760017157 0ustar00solution = [ ]; $this->uri = '/HostedNumber/Orders'; } /** * Create the HostedNumberOrderInstance * * @param string $phoneNumber The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. * @param string $addressSid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. * @param string $email Optional. Email of the owner of this phone number that is being hosted. * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Created HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, string $contactPhoneNumber, string $addressSid, string $email, array $options = []): HostedNumberOrderInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'ContactPhoneNumber' => $contactPhoneNumber, 'AddressSid' => $addressSid, 'Email' => $email, 'AccountSid' => $options['accountSid'], 'FriendlyName' => $options['friendlyName'], 'CcEmails' => Serialize::map($options['ccEmails'], function ($e) { return $e; }), 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsCapability' => Serialize::booleanToString($options['smsCapability']), 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'StatusCallbackUrl' => $options['statusCallbackUrl'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'ContactTitle' => $options['contactTitle'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new HostedNumberOrderInstance( $this->version, $payload ); } /** * Reads HostedNumberOrderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return HostedNumberOrderInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams HostedNumberOrderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return HostedNumberOrderPage Page of HostedNumberOrderInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): HostedNumberOrderPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'SmsCapability' => Serialize::booleanToString($options['smsCapability']), 'PhoneNumber' => $options['phoneNumber'], 'IncomingPhoneNumberSid' => $options['incomingPhoneNumberSid'], 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new HostedNumberOrderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return HostedNumberOrderPage Page of HostedNumberOrderInstance */ public function getPage(string $targetUrl): HostedNumberOrderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new HostedNumberOrderPage($this->version, $response, $this->solution); } /** * Constructs a HostedNumberOrderContext * * @param string $sid A 34 character string that uniquely identifies this HostedNumberOrder. */ public function getContext( string $sid ): HostedNumberOrderContext { return new HostedNumberOrderContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.HostedNumberOrderList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryComplianceList.php000064400000013246150364341760017716 0ustar00solution = [ ]; } /** * Access the regulations */ protected function getRegulations(): RegulationList { if (!$this->_regulations) { $this->_regulations = new RegulationList( $this->version ); } return $this->_regulations; } /** * Access the supportingDocuments */ protected function getSupportingDocuments(): SupportingDocumentList { if (!$this->_supportingDocuments) { $this->_supportingDocuments = new SupportingDocumentList( $this->version ); } return $this->_supportingDocuments; } /** * Access the bundles */ protected function getBundles(): BundleList { if (!$this->_bundles) { $this->_bundles = new BundleList( $this->version ); } return $this->_bundles; } /** * Access the endUserTypes */ protected function getEndUserTypes(): EndUserTypeList { if (!$this->_endUserTypes) { $this->_endUserTypes = new EndUserTypeList( $this->version ); } return $this->_endUserTypes; } /** * Access the endUsers */ protected function getEndUsers(): EndUserList { if (!$this->_endUsers) { $this->_endUsers = new EndUserList( $this->version ); } return $this->_endUsers; } /** * Access the supportingDocumentTypes */ protected function getSupportingDocumentTypes(): SupportingDocumentTypeList { if (!$this->_supportingDocumentTypes) { $this->_supportingDocumentTypes = new SupportingDocumentTypeList( $this->version ); } return $this->_supportingDocumentTypes; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.RegulatoryComplianceList]'; } } sdk/src/Twilio/Rest/Numbers/V2/HostedNumberOrderPage.php000064400000003112150364341760017111 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return HostedNumberOrderInstance \Twilio\Rest\Numbers\V2\HostedNumberOrderInstance */ public function buildInstance(array $payload): HostedNumberOrderInstance { return new HostedNumberOrderInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.HostedNumberOrderPage]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserInstance.php000064400000010743150364341760022113 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EndUserContext Context for this EndUserInstance */ protected function proxy(): EndUserContext { if (!$this->context) { $this->context = new EndUserContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the EndUserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EndUserInstance * * @return EndUserInstance Fetched EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserInstance { return $this->proxy()->fetch(); } /** * Update the EndUserInstance * * @param array|Options $options Optional Arguments * @return EndUserInstance Updated EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): EndUserInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.EndUserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php000064400000004033150364341760022630 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php000064400000004211150364341760025132 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentInstance.php000064400000011733150364341760024417 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'mimeType' => Values::array_get($payload, 'mime_type'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'type' => Values::array_get($payload, 'type'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SupportingDocumentContext Context for this SupportingDocumentInstance */ protected function proxy(): SupportingDocumentContext { if (!$this->context) { $this->context = new SupportingDocumentContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SupportingDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SupportingDocumentInstance * * @return SupportingDocumentInstance Fetched SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentInstance { return $this->proxy()->fetch(); } /** * Update the SupportingDocumentInstance * * @param array|Options $options Optional Arguments * @return SupportingDocumentInstance Updated SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SupportingDocumentInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.SupportingDocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserOptions.php000064400000010556150364341760022004 0ustar00options['attributes'] = $attributes; } /** * The set of parameters that are the attributes of the End User resource which are derived End User Types. * * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.CreateEndUserOptions ' . $options . ']'; } } class UpdateEndUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. */ public function __construct( string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The set of parameters that are the attributes of the End User resource which are derived End User Types. * * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.UpdateEndUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleOptions.php000064400000051664150364341760021655 0ustar00=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * @return ReadBundleOptions Options builder */ public static function read( string $status = Values::NONE, string $friendlyName = Values::NONE, string $regulationSid = Values::NONE, string $isoCountry = Values::NONE, string $numberType = Values::NONE, bool $hasValidUntilDate = Values::BOOL_NONE, string $sortBy = Values::NONE, string $sortDirection = Values::NONE, string $validUntilDateBefore = null, string $validUntilDate = null, string $validUntilDateAfter = null ): ReadBundleOptions { return new ReadBundleOptions( $status, $friendlyName, $regulationSid, $isoCountry, $numberType, $hasValidUntilDate, $sortBy, $sortDirection, $validUntilDateBefore, $validUntilDate, $validUntilDateAfter ); } /** * @param string $status * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Bundle resource changes status. * @return UpdateBundleOptions Options builder */ public static function update( string $status = Values::NONE, string $statusCallback = Values::NONE, string $friendlyName = Values::NONE, string $email = Values::NONE ): UpdateBundleOptions { return new UpdateBundleOptions( $status, $statusCallback, $friendlyName, $email ); } } class CreateBundleOptions extends Options { /** * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $regulationSid The unique string of a regulation that is associated to the Bundle resource. * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. * @param string $endUserType * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. */ public function __construct( string $statusCallback = Values::NONE, string $regulationSid = Values::NONE, string $isoCountry = Values::NONE, string $endUserType = Values::NONE, string $numberType = Values::NONE ) { $this->options['statusCallback'] = $statusCallback; $this->options['regulationSid'] = $regulationSid; $this->options['isoCountry'] = $isoCountry; $this->options['endUserType'] = $endUserType; $this->options['numberType'] = $numberType; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The unique string of a regulation that is associated to the Bundle resource. * * @param string $regulationSid The unique string of a regulation that is associated to the Bundle resource. * @return $this Fluent Builder */ public function setRegulationSid(string $regulationSid): self { $this->options['regulationSid'] = $regulationSid; return $this; } /** * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. * * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * @param string $endUserType * @return $this Fluent Builder */ public function setEndUserType(string $endUserType): self { $this->options['endUserType'] = $endUserType; return $this; } /** * The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. * * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. * @return $this Fluent Builder */ public function setNumberType(string $numberType): self { $this->options['numberType'] = $numberType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.CreateBundleOptions ' . $options . ']'; } } class ReadBundleOptions extends Options { /** * @param string $status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. * @param string $friendlyName The string that you assigned to describe the resource. The column can contain 255 variable characters. * @param string $regulationSid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. * @param string $isoCountry The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. * @param bool $hasValidUntilDate Indicates that the Bundle is a valid Bundle until a specified expiration date. * @param string $sortBy Can be `valid-until` or `date-updated`. Defaults to `date-created`. * @param string $sortDirection Default is `DESC`. Can be `ASC` or `DESC`. * @param string $validUntilDateBefore Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */ public function __construct( string $status = Values::NONE, string $friendlyName = Values::NONE, string $regulationSid = Values::NONE, string $isoCountry = Values::NONE, string $numberType = Values::NONE, bool $hasValidUntilDate = Values::BOOL_NONE, string $sortBy = Values::NONE, string $sortDirection = Values::NONE, string $validUntilDateBefore = null, string $validUntilDate = null, string $validUntilDateAfter = null ) { $this->options['status'] = $status; $this->options['friendlyName'] = $friendlyName; $this->options['regulationSid'] = $regulationSid; $this->options['isoCountry'] = $isoCountry; $this->options['numberType'] = $numberType; $this->options['hasValidUntilDate'] = $hasValidUntilDate; $this->options['sortBy'] = $sortBy; $this->options['sortDirection'] = $sortDirection; $this->options['validUntilDateBefore'] = $validUntilDateBefore; $this->options['validUntilDate'] = $validUntilDate; $this->options['validUntilDateAfter'] = $validUntilDateAfter; } /** * The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. * * @param string $status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The string that you assigned to describe the resource. The column can contain 255 variable characters. * * @param string $friendlyName The string that you assigned to describe the resource. The column can contain 255 variable characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. * * @param string $regulationSid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. * @return $this Fluent Builder */ public function setRegulationSid(string $regulationSid): self { $this->options['regulationSid'] = $regulationSid; return $this; } /** * The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. * * @param string $isoCountry The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. * * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. * @return $this Fluent Builder */ public function setNumberType(string $numberType): self { $this->options['numberType'] = $numberType; return $this; } /** * Indicates that the Bundle is a valid Bundle until a specified expiration date. * * @param bool $hasValidUntilDate Indicates that the Bundle is a valid Bundle until a specified expiration date. * @return $this Fluent Builder */ public function setHasValidUntilDate(bool $hasValidUntilDate): self { $this->options['hasValidUntilDate'] = $hasValidUntilDate; return $this; } /** * Can be `valid-until` or `date-updated`. Defaults to `date-created`. * * @param string $sortBy Can be `valid-until` or `date-updated`. Defaults to `date-created`. * @return $this Fluent Builder */ public function setSortBy(string $sortBy): self { $this->options['sortBy'] = $sortBy; return $this; } /** * Default is `DESC`. Can be `ASC` or `DESC`. * * @param string $sortDirection Default is `DESC`. Can be `ASC` or `DESC`. * @return $this Fluent Builder */ public function setSortDirection(string $sortDirection): self { $this->options['sortDirection'] = $sortDirection; return $this; } /** * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * * @param string $validUntilDateBefore Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * @return $this Fluent Builder */ public function setValidUntilDateBefore(string $validUntilDateBefore): self { $this->options['validUntilDateBefore'] = $validUntilDateBefore; return $this; } /** * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * @return $this Fluent Builder */ public function setValidUntilDate(string $validUntilDate): self { $this->options['validUntilDate'] = $validUntilDate; return $this; } /** * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. * @return $this Fluent Builder */ public function setValidUntilDateAfter(string $validUntilDateAfter): self { $this->options['validUntilDateAfter'] = $validUntilDateAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.ReadBundleOptions ' . $options . ']'; } } class UpdateBundleOptions extends Options { /** * @param string $status * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Bundle resource changes status. */ public function __construct( string $status = Values::NONE, string $statusCallback = Values::NONE, string $friendlyName = Values::NONE, string $email = Values::NONE ) { $this->options['status'] = $status; $this->options['statusCallback'] = $statusCallback; $this->options['friendlyName'] = $friendlyName; $this->options['email'] = $email; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The email address that will receive updates when the Bundle resource changes status. * * @param string $email The email address that will receive updates when the Bundle resource changes status. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.UpdateBundleOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeInstance.php000064400000006776150364341760022770 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationPage.php000064400000003112150364341760021757 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php000064400000004413150364341760023743 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentList.php000064400000014377150364341760024064 0ustar00solution = [ 'bundleSid' => $bundleSid, ]; $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) .'/ItemAssignments'; } /** * Create the ItemAssignmentInstance * * @param string $objectSid The SID of an object bag that holds information of the different items. * @return ItemAssignmentInstance Created ItemAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $objectSid): ItemAssignmentInstance { $data = Values::of([ 'ObjectSid' => $objectSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ItemAssignmentInstance( $this->version, $payload, $this->solution['bundleSid'] ); } /** * Reads ItemAssignmentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ItemAssignmentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ItemAssignmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ItemAssignmentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ItemAssignmentPage Page of ItemAssignmentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ItemAssignmentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ItemAssignmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ItemAssignmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ItemAssignmentPage Page of ItemAssignmentInstance */ public function getPage(string $targetUrl): ItemAssignmentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ItemAssignmentPage($this->version, $response, $this->solution); } /** * Constructs a ItemAssignmentContext * * @param string $sid The unique string that we created to identify the Identity resource. */ public function getContext( string $sid ): ItemAssignmentContext { return new ItemAssignmentContext( $this->version, $this->solution['bundleSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.ItemAssignmentList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyOptions.php000064400000004002150364341760023701 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php000064400000005153150364341760024565 0ustar00solution = [ 'bundleSid' => $bundleSid, 'sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) .'/ItemAssignments/' . \rawurlencode($sid) .''; } /** * Delete the ItemAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationInstance.php000064400000010024150364341760024056 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentPage.php000064400000003216150364341760024013 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsPage.php000064400000003202150364341760023434 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentInstance.php000064400000010234150364341760024701 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'objectSid' => Values::array_get($payload, 'object_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['bundleSid' => $bundleSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ItemAssignmentContext Context for this ItemAssignmentInstance */ protected function proxy(): ItemAssignmentContext { if (!$this->context) { $this->context = new ItemAssignmentContext( $this->version, $this->solution['bundleSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ItemAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ItemAssignmentInstance * * @return ItemAssignmentInstance Fetched ItemAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ItemAssignmentInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.ItemAssignmentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsList.php000064400000004327150364341760023504 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyList.php000064400000013450150364341760023170 0ustar00solution = [ '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'] ); } /** * Reads BundleCopyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BundleCopyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BundleCopyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BundleCopyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BundleCopyPage Page of BundleCopyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BundleCopyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BundleCopyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BundleCopyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BundleCopyPage Page of BundleCopyInstance */ public function getPage(string $targetUrl): BundleCopyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BundleCopyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.BundleCopyList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyInstance.php000064400000006302150364341760024017 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php000064400000013640150364341760023234 0ustar00solution = [ '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'] ); } /** * Reads EvaluationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EvaluationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EvaluationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EvaluationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EvaluationPage Page of EvaluationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EvaluationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EvaluationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EvaluationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EvaluationPage Page of EvaluationInstance */ public function getPage(string $targetUrl): EvaluationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EvaluationPage($this->version, $response, $this->solution); } /** * Constructs a EvaluationContext * * @param string $sid The unique string that identifies the Evaluation resource. */ public function getContext( string $sid ): EvaluationContext { return new EvaluationContext( $this->version, $this->solution['bundleSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.EvaluationList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyPage.php000064400000003166150364341760023134 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationPage.php000064400000003166150364341760023177 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsInstance.php000064400000006357150364341760024342 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserPage.php000064400000003070150364341760021216 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeList.php000064400000012304150364341760022117 0ustar00solution = [ ]; $this->uri = '/RegulatoryCompliance/EndUserTypes'; } /** * Reads EndUserTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EndUserTypeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EndUserTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EndUserTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EndUserTypePage Page of EndUserTypeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EndUserTypePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EndUserTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EndUserTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EndUserTypePage Page of EndUserTypeInstance */ public function getPage(string $targetUrl): EndUserTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EndUserTypePage($this->version, $response, $this->solution); } /** * Constructs a EndUserTypeContext * * @param string $sid The unique string that identifies the End-User Type resource. */ public function getContext( string $sid ): EndUserTypeContext { return new EndUserTypeContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.EndUserTypeList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleList.php000064400000017045150364341760021130 0ustar00solution = [ ]; $this->uri = '/RegulatoryCompliance/Bundles'; } /** * Create the BundleInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Bundle resource changes status. * @param array|Options $options Optional Arguments * @return BundleInstance Created BundleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $email, array $options = []): BundleInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Email' => $email, 'StatusCallback' => $options['statusCallback'], 'RegulationSid' => $options['regulationSid'], 'IsoCountry' => $options['isoCountry'], 'EndUserType' => $options['endUserType'], 'NumberType' => $options['numberType'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BundleInstance( $this->version, $payload ); } /** * Reads BundleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BundleInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BundleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BundleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BundlePage Page of BundleInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BundlePage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'FriendlyName' => $options['friendlyName'], 'RegulationSid' => $options['regulationSid'], 'IsoCountry' => $options['isoCountry'], 'NumberType' => $options['numberType'], 'HasValidUntilDate' => Serialize::booleanToString($options['hasValidUntilDate']), 'SortBy' => $options['sortBy'], 'SortDirection' => $options['sortDirection'], 'ValidUntilDate<' => Serialize::iso8601DateTime($options['validUntilDateBefore']), 'ValidUntilDate' => Serialize::iso8601DateTime($options['validUntilDate']), 'ValidUntilDate>' => Serialize::iso8601DateTime($options['validUntilDateAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BundlePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BundleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BundlePage Page of BundleInstance */ public function getPage(string $targetUrl): BundlePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BundlePage($this->version, $response, $this->solution); } /** * Constructs a BundleContext * * @param string $sid The unique string that we created to identify the Bundle resource. */ public function getContext( string $sid ): BundleContext { return new BundleContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.BundleList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentOptions.php000064400000011233150364341760024301 0ustar00options['attributes'] = $attributes; } /** * The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. * * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.CreateSupportingDocumentOptions ' . $options . ']'; } } class UpdateSupportingDocumentOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. */ public function __construct( string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. * * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V2.UpdateSupportingDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleInstance.php000064400000013712150364341760021756 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'regulationSid' => Values::array_get($payload, 'regulation_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), 'email' => Values::array_get($payload, 'email'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BundleContext Context for this BundleInstance */ protected function proxy(): BundleContext { if (!$this->context) { $this->context = new BundleContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the BundleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BundleInstance * * @return BundleInstance Fetched BundleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BundleInstance { return $this->proxy()->fetch(); } /** * Update the BundleInstance * * @param array|Options $options Optional Arguments * @return BundleInstance Updated BundleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): BundleInstance { return $this->proxy()->update($options); } /** * Access the replaceItems */ protected function getReplaceItems(): ReplaceItemsList { return $this->proxy()->replaceItems; } /** * Access the evaluations */ protected function getEvaluations(): EvaluationList { return $this->proxy()->evaluations; } /** * Access the bundleCopies */ protected function getBundleCopies(): BundleCopyList { return $this->proxy()->bundleCopies; } /** * Access the itemAssignments */ protected function getItemAssignments(): ItemAssignmentList { return $this->proxy()->itemAssignments; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.BundleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php000064400000004017150364341760022534 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php000064400000006404150364341760024276 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/SupportingDocuments/' . \rawurlencode($sid) .''; } /** * Delete the SupportingDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypePage.php000064400000003120150364341760022054 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserList.php000064400000014135150364341760021261 0ustar00solution = [ ]; $this->uri = '/RegulatoryCompliance/EndUsers'; } /** * Create the EndUserInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $type * @param array|Options $options Optional Arguments * @return EndUserInstance Created EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $options = []): EndUserInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Attributes' => Serialize::jsonObject($options['attributes']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EndUserInstance( $this->version, $payload ); } /** * Reads EndUserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EndUserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EndUserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EndUserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EndUserPage Page of EndUserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EndUserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EndUserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EndUserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EndUserPage Page of EndUserInstance */ public function getPage(string $targetUrl): EndUserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EndUserPage($this->version, $response, $this->solution); } /** * Constructs a EndUserContext * * @param string $sid The unique string created by Twilio to identify the End User resource. */ public function getContext( string $sid ): EndUserContext { return new EndUserContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.EndUserList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypePage.php000064400000003222150364341760024363 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundlePage.php000064400000003062150364341760021063 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentPage.php000064400000003172150364341760023525 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationOptions.php000064400000006741150364341760022551 0ustar00options['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 the regulation requires - can be `individual` or `business`. * @return $this Fluent Builder */ public function setEndUserType(string $endUserType): self { $this->options['endUserType'] = $endUserType; return $this; } /** * The ISO country code of the phone number's country. * * @param string $isoCountry The ISO country code of the phone number's country. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * The type of phone number that the regulatory requiremnt is restricting. * * @param string $numberType The type of phone number that the regulatory requiremnt is restricting. * @return $this Fluent Builder */ public function setNumberType(string $numberType): self { $this->options['numberType'] = $numberType; return $this; } /** * 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 . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationList.php000064400000013203150364341760022020 0ustar00solution = [ ]; $this->uri = '/RegulatoryCompliance/Regulations'; } /** * Reads RegulationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RegulationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RegulationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RegulationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RegulationPage Page of RegulationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RegulationPage { $options = new Values($options); $params = Values::of([ 'EndUserType' => $options['endUserType'], 'IsoCountry' => $options['isoCountry'], 'NumberType' => $options['numberType'], '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]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php000064400000006124150364341760021771 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/EndUsers/' . \rawurlencode($sid) .''; } /** * Delete the EndUserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeInstance.php000064400000007202150364341760025255 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentList.php000064400000014640150364341760023566 0ustar00solution = [ ]; $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 ); } /** * Reads SupportingDocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SupportingDocumentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SupportingDocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SupportingDocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SupportingDocumentPage Page of SupportingDocumentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SupportingDocumentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SupportingDocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SupportingDocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SupportingDocumentPage Page of SupportingDocumentInstance */ public function getPage(string $targetUrl): SupportingDocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SupportingDocumentPage($this->version, $response, $this->solution); } /** * Constructs a SupportingDocumentContext * * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. */ public function getContext( string $sid ): SupportingDocumentContext { return new SupportingDocumentContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.SupportingDocumentList]'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php000064400000014673150364341760021645 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($sid) .''; } /** * Delete the BundleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the replaceItems */ protected function getReplaceItems(): ReplaceItemsList { if (!$this->_replaceItems) { $this->_replaceItems = new ReplaceItemsList( $this->version, $this->solution['sid'] ); } return $this->_replaceItems; } /** * Access the evaluations */ protected function getEvaluations(): EvaluationList { if (!$this->_evaluations) { $this->_evaluations = new EvaluationList( $this->version, $this->solution['sid'] ); } return $this->_evaluations; } /** * Access the bundleCopies */ protected function getBundleCopies(): BundleCopyList { if (!$this->_bundleCopies) { $this->_bundleCopies = new BundleCopyList( $this->version, $this->solution['sid'] ); } return $this->_bundleCopies; } /** * Access the itemAssignments */ protected function getItemAssignments(): ItemAssignmentList { if (!$this->_itemAssignments) { $this->_itemAssignments = new ItemAssignmentList( $this->version, $this->solution['sid'] ); } return $this->_itemAssignments; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V2.BundleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationInstance.php000064400000007326150364341760022662 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeList.php000064400000012653150364341760024432 0ustar00solution = [ ]; $this->uri = '/RegulatoryCompliance/SupportingDocumentTypes'; } /** * Reads SupportingDocumentTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SupportingDocumentTypeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SupportingDocumentTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SupportingDocumentTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SupportingDocumentTypePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SupportingDocumentTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SupportingDocumentTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance */ public function getPage(string $targetUrl): SupportingDocumentTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SupportingDocumentTypePage($this->version, $response, $this->solution); } /** * Constructs a SupportingDocumentTypeContext * * @param string $sid The unique string that identifies the Supporting Document Type resource. */ public function getContext( string $sid ): SupportingDocumentTypeContext { return new SupportingDocumentTypeContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.SupportingDocumentTypeList]'; } } sdk/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderList.php000064400000003117150364341760017773 0ustar00solution = [ ]; } /** * Constructs a BulkHostedNumberOrderContext * * @param string $bulkHostingSid A 34 character string that uniquely identifies this BulkHostedNumberOrder. */ public function getContext( string $bulkHostingSid ): BulkHostedNumberOrderContext { return new BulkHostedNumberOrderContext( $this->version, $bulkHostingSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.BulkHostedNumberOrderList]'; } } sdk/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentPage.php000064400000003142150364341760020060 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthorizationDocumentInstance \Twilio\Rest\Numbers\V2\AuthorizationDocumentInstance */ public function buildInstance(array $payload): AuthorizationDocumentInstance { return new AuthorizationDocumentInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2.AuthorizationDocumentPage]'; } } sdk/src/Twilio/Rest/Numbers/V2.php000064400000010217150364341760012725 0ustar00version = 'v2'; } protected function getAuthorizationDocuments(): AuthorizationDocumentList { if (!$this->_authorizationDocuments) { $this->_authorizationDocuments = new AuthorizationDocumentList($this); } return $this->_authorizationDocuments; } protected function getBulkHostedNumberOrders(): BulkHostedNumberOrderList { if (!$this->_bulkHostedNumberOrders) { $this->_bulkHostedNumberOrders = new BulkHostedNumberOrderList($this); } return $this->_bulkHostedNumberOrders; } protected function getHostedNumberOrders(): HostedNumberOrderList { if (!$this->_hostedNumberOrders) { $this->_hostedNumberOrders = new HostedNumberOrderList($this); } return $this->_hostedNumberOrders; } protected function getRegulatoryCompliance(): RegulatoryComplianceList { if (!$this->_regulatoryCompliance) { $this->_regulatoryCompliance = new RegulatoryComplianceList($this); } return $this->_regulatoryCompliance; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V2]'; } } sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityInstance.php000064400000007566150364341760017512 0ustar00properties = [ 'requestId' => Values::array_get($payload, 'request_id'), 'url' => Values::array_get($payload, 'url'), 'results' => Values::array_get($payload, 'results'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), ]; $this->solution = ['requestId' => $requestId ?: $this->properties['requestId'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BulkEligibilityContext Context for this BulkEligibilityInstance */ protected function proxy(): BulkEligibilityContext { if (!$this->context) { $this->context = new BulkEligibilityContext( $this->version, $this->solution['requestId'] ); } return $this->context; } /** * Fetch the BulkEligibilityInstance * * @return BulkEligibilityInstance Fetched BulkEligibilityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BulkEligibilityInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V1.BulkEligibilityInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityContext.php000064400000004673150364341760020147 0ustar00solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/Porting/Portability/PhoneNumber/' . \rawurlencode($phoneNumber) .''; } /** * Fetch the PortingPortabilityInstance * * @param array|Options $options Optional Arguments * @return PortingPortabilityInstance Fetched PortingPortabilityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PortingPortabilityInstance { $options = new Values($options); $params = Values::of([ 'TargetAccountSid' => $options['targetAccountSid'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new PortingPortabilityInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V1.PortingPortabilityContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityList.php000064400000003024150364341760016642 0ustar00solution = [ ]; } /** * Constructs a BulkEligibilityContext * * @param string $requestId The SID of the bulk eligibility check that you want to know about. */ public function getContext( string $requestId ): BulkEligibilityContext { return new BulkEligibilityContext( $this->version, $requestId ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V1.BulkEligibilityList]'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingBulkPortabilityInstance.php000064400000007243150364341760021101 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'datetimeCreated' => Deserialize::dateTime(Values::array_get($payload, 'datetime_created')), 'phoneNumbers' => Values::array_get($payload, 'phone_numbers'), '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 PortingBulkPortabilityContext Context for this PortingBulkPortabilityInstance */ protected function proxy(): PortingBulkPortabilityContext { if (!$this->context) { $this->context = new PortingBulkPortabilityContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the PortingBulkPortabilityInstance * * @return PortingBulkPortabilityInstance Fetched PortingBulkPortabilityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PortingBulkPortabilityInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V1.PortingBulkPortabilityInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingBulkPortabilityPage.php000064400000003150150364341760020202 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return PortingBulkPortabilityInstance \Twilio\Rest\Numbers\V1\PortingBulkPortabilityInstance */ public function buildInstance(array $payload): PortingBulkPortabilityInstance { return new PortingBulkPortabilityInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V1.PortingBulkPortabilityPage]'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityPage.php000064400000003120150364341760017361 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return PortingPortabilityInstance \Twilio\Rest\Numbers\V1\PortingPortabilityInstance */ public function buildInstance(array $payload): PortingPortabilityInstance { return new PortingPortabilityInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V1.PortingPortabilityPage]'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityList.php000064400000003125150364341760017425 0ustar00solution = [ ]; } /** * Constructs a PortingPortabilityContext * * @param string $phoneNumber The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212). */ public function getContext( string $phoneNumber ): PortingPortabilityContext { return new PortingPortabilityContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V1.PortingPortabilityList]'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityOptions.php000064400000004122150364341760020143 0ustar00options['targetAccountSid'] = $targetAccountSid; } /** * The SID of the account where the phone number(s) will be ported. * * @param string $targetAccountSid The SID of the account where the phone number(s) will be ported. * @return $this Fluent Builder */ public function setTargetAccountSid(string $targetAccountSid): self { $this->options['targetAccountSid'] = $targetAccountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Numbers.V1.FetchPortingPortabilityOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityContext.php000064400000004113150364341760017353 0ustar00solution = [ 'requestId' => $requestId, ]; $this->uri = '/HostedNumber/Eligibility/Bulk/' . \rawurlencode($requestId) .''; } /** * Fetch the BulkEligibilityInstance * * @return BulkEligibilityInstance Fetched BulkEligibilityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BulkEligibilityInstance { $payload = $this->version->fetch('GET', $this->uri); return new BulkEligibilityInstance( $this->version, $payload, $this->solution['requestId'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V1.BulkEligibilityContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingBulkPortabilityContext.php000064400000004130150364341760020751 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Porting/Portability/' . \rawurlencode($sid) .''; } /** * Fetch the PortingBulkPortabilityInstance * * @return PortingBulkPortabilityInstance Fetched PortingBulkPortabilityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PortingBulkPortabilityInstance { $payload = $this->version->fetch('GET', $this->uri); return new PortingBulkPortabilityInstance( $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.V1.PortingBulkPortabilityContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingPortabilityInstance.php000064400000011017150364341760020255 0ustar00properties = [ 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'portable' => Values::array_get($payload, 'portable'), 'pinAndAccountNumberRequired' => Values::array_get($payload, 'pin_and_account_number_required'), 'notPortableReason' => Values::array_get($payload, 'not_portable_reason'), 'notPortableReasonCode' => Values::array_get($payload, 'not_portable_reason_code'), 'numberType' => Values::array_get($payload, 'number_type'), 'country' => Values::array_get($payload, 'country'), 'messagingCarrier' => Values::array_get($payload, 'messaging_carrier'), 'voiceCarrier' => Values::array_get($payload, 'voice_carrier'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PortingPortabilityContext Context for this PortingPortabilityInstance */ protected function proxy(): PortingPortabilityContext { if (!$this->context) { $this->context = new PortingPortabilityContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Fetch the PortingPortabilityInstance * * @param array|Options $options Optional Arguments * @return PortingPortabilityInstance Fetched PortingPortabilityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PortingPortabilityInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Numbers.V1.PortingPortabilityInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Numbers/V1/BulkEligibilityPage.php000064400000003076150364341760016612 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return BulkEligibilityInstance \Twilio\Rest\Numbers\V1\BulkEligibilityInstance */ public function buildInstance(array $payload): BulkEligibilityInstance { return new BulkEligibilityInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V1.BulkEligibilityPage]'; } } sdk/src/Twilio/Rest/Numbers/V1/PortingBulkPortabilityList.php000064400000004747150364341760020256 0ustar00solution = [ ]; $this->uri = '/Porting/Portability'; } /** * Create the PortingBulkPortabilityInstance * * @param string[] $phoneNumbers The phone numbers which portability is to be checked. This should be a list of strings. Phone numbers are in E.164 format (e.g. +16175551212). . * @return PortingBulkPortabilityInstance Created PortingBulkPortabilityInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $phoneNumbers): PortingBulkPortabilityInstance { $data = Values::of([ 'PhoneNumbers' => Serialize::map($phoneNumbers,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PortingBulkPortabilityInstance( $this->version, $payload ); } /** * Constructs a PortingBulkPortabilityContext * * @param string $sid A 34 character string that uniquely identifies the Portability check. */ public function getContext( string $sid ): PortingBulkPortabilityContext { return new PortingBulkPortabilityContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers.V1.PortingBulkPortabilityList]'; } } sdk/src/Twilio/Rest/Proxy.php000064400000001271150364341760012144 0ustar00services instead. */ protected function getServices(): \Twilio\Rest\Proxy\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextServices(string $sid): \Twilio\Rest\Proxy\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } }sdk/src/Twilio/Rest/Lookups.php000064400000001437150364341760012463 0ustar00phoneNumbers instead. */ protected function getPhoneNumbers(): \Twilio\Rest\Lookups\V1\PhoneNumberList { echo "phoneNumbers is deprecated. Use v1->phoneNumbers instead."; return $this->v1->phoneNumbers; } /** * @deprecated Use v1->phoneNumbers(\$phoneNumber) instead. * @param string $phoneNumber The phone number to fetch in E.164 format */ protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Lookups\V1\PhoneNumberContext { echo "phoneNumbers(\$phoneNumber) is deprecated. Use v1->phoneNumbers(\$phoneNumber) instead."; return $this->v1->phoneNumbers($phoneNumber); } }sdk/src/Twilio/Rest/VerifyBase.php000064400000004522150364341760013064 0ustar00baseUrl = 'https://verify.twilio.com'; } /** * @return V2 Version v2 of verify */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify]'; } } sdk/src/Twilio/Rest/ProxyBase.php000064400000004513150364341760012741 0ustar00baseUrl = 'https://proxy.twilio.com'; } /** * @return V1 Version v1 of proxy */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy]'; } } sdk/src/Twilio/Rest/Proxy/V1.php000064400000005057150364341760012440 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php000064400000003101150364341760016513 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php000064400000003115150364341760017050 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionPage.php000064400000003065150364341760016255 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php000064400000012466150364341760017751 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'url' => Values::array_get($payload, 'url'), 'isReserved' => Values::array_get($payload, 'is_reserved'), 'inUse' => Values::array_get($payload, 'in_use'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the PhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { return $this->proxy()->fetch(); } /** * Update the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Updated PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): PhoneNumberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionOptions.php000064400000021535150364341760017036 0ustar00options['uniqueName'] = $uniqueName; $this->options['dateExpiry'] = $dateExpiry; $this->options['ttl'] = $ttl; $this->options['mode'] = $mode; $this->options['status'] = $status; $this->options['participants'] = $participants; } /** * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. * * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. * @return $this Fluent Builder */ public function setDateExpiry(\DateTime $dateExpiry): self { $this->options['dateExpiry'] = $dateExpiry; return $this; } /** * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. * * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * @param string $mode * @return $this Fluent Builder */ public function setMode(string $mode): self { $this->options['mode'] = $mode; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The Participant objects to include in the new session. * * @param array[] $participants The Participant objects to include in the new session. * @return $this Fluent Builder */ public function setParticipants(array $participants): self { $this->options['participants'] = $participants; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.CreateSessionOptions ' . $options . ']'; } } class UpdateSessionOptions extends Options { /** * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. * @param string $status */ public function __construct( \DateTime $dateExpiry = null, int $ttl = Values::INT_NONE, string $status = Values::NONE ) { $this->options['dateExpiry'] = $dateExpiry; $this->options['ttl'] = $ttl; $this->options['status'] = $status; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. * * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. * @return $this Fluent Builder */ public function setDateExpiry(\DateTime $dateExpiry): self { $this->options['dateExpiry'] = $dateExpiry; return $this; } /** * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. * * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.UpdateSessionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php000064400000013422150364341760017023 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Sessions/' . \rawurlencode($sid) .''; } /** * Delete the SessionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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 participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_participants; } /** * Access the interactions */ protected function getInteractions(): InteractionList { if (!$this->_interactions) { $this->_interactions = new InteractionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_interactions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.SessionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php000064400000006630150364341760017625 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php000064400000014632150364341760017115 0ustar00solution = [ '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'] ); } /** * Reads PhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PhoneNumberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PhoneNumberPage Page of PhoneNumberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PhoneNumberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PhoneNumberPage Page of PhoneNumberInstance */ public function getPage(string $targetUrl): PhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a PhoneNumberContext * * @param string $sid The Twilio-provided string that uniquely identifies the PhoneNumber resource to delete. */ public function getContext( string $sid ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php000064400000016150150364341760017632 0ustar00options['sid'] = $sid; $this->options['phoneNumber'] = $phoneNumber; $this->options['isReserved'] = $isReserved; } /** * The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. * * @param string $sid The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. * @return $this Fluent Builder */ public function setSid(string $sid): self { $this->options['sid'] = $sid; return $this; } /** * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * * @param string $phoneNumber The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * * @param bool $isReserved Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * @return $this Fluent Builder */ public function setIsReserved(bool $isReserved): self { $this->options['isReserved'] = $isReserved; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.CreatePhoneNumberOptions ' . $options . ']'; } } class UpdatePhoneNumberOptions extends Options { /** * @param bool $isReserved Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. */ public function __construct( bool $isReserved = Values::BOOL_NONE ) { $this->options['isReserved'] = $isReserved; } /** * Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * * @param bool $isReserved Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * @return $this Fluent Builder */ public function setIsReserved(bool $isReserved): self { $this->options['isReserved'] = $isReserved; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.UpdatePhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php000064400000012047150364341760017414 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'shortCode' => Values::array_get($payload, 'short_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'url' => Values::array_get($payload, 'url'), 'isReserved' => Values::array_get($payload, 'is_reserved'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ShortCodeContext Context for this ShortCodeInstance */ protected function proxy(): ShortCodeContext { if (!$this->context) { $this->context = new ShortCodeContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ShortCodeInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ShortCodeInstance { return $this->proxy()->fetch(); } /** * Update the ShortCodeInstance * * @param array|Options $options Optional Arguments * @return ShortCodeInstance Updated ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ShortCodeInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ShortCodeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.php000064400000005056150364341760017305 0ustar00options['isReserved'] = $isReserved; } /** * Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * * @param bool $isReserved Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * @return $this Fluent Builder */ public function setIsReserved(bool $isReserved): self { $this->options['isReserved'] = $isReserved; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.UpdateShortCodeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionList.php000064400000015030150364341760016307 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Sessions'; } /** * Create the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Created SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): SessionInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'DateExpiry' => Serialize::iso8601DateTime($options['dateExpiry']), 'Ttl' => $options['ttl'], 'Mode' => $options['mode'], 'Status' => $options['status'], 'Participants' => Serialize::map($options['participants'], function ($e) { return Serialize::jsonObject($e); }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SessionInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads SessionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SessionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SessionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SessionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SessionPage Page of SessionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SessionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SessionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SessionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SessionPage Page of SessionInstance */ public function getPage(string $targetUrl): SessionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SessionPage($this->version, $response, $this->solution); } /** * Constructs a SessionContext * * @param string $sid The Twilio-provided string that uniquely identifies the Session resource to delete. */ public function getContext( string $sid ): SessionContext { return new SessionContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy.V1.SessionList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php000064400000006537150364341760017303 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php000064400000014312150364341760016560 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/ShortCodes'; } /** * Create the ShortCodeInstance * * @param string $sid The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. * @return ShortCodeInstance Created ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $sid): ShortCodeInstance { $data = Values::of([ 'Sid' => $sid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ShortCodeInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads ShortCodeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ShortCodeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ShortCodePage Page of ShortCodeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ShortCodePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ShortCodePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ShortCodeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ShortCodePage Page of ShortCodeInstance */ public function getPage(string $targetUrl): ShortCodePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Constructs a ShortCodeContext * * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to delete. */ public function getContext( string $sid ): ShortCodeContext { return new ShortCodeContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy.V1.ShortCodeList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php000064400000011416150364341760021302 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Sessions/' . \rawurlencode($sessionSid) .'/Participants/' . \rawurlencode($sid) .''; } /** * Delete the ParticipantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php000064400000004730150364341760025076 0ustar00options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; } /** * The message to send to the participant * * @param string $body The message to send to the participant * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * Reserved. Not currently supported. * * @param string[] $mediaUrl Reserved. Not currently supported. * @return $this Fluent Builder */ public function setMediaUrl(array $mediaUrl): self { $this->options['mediaUrl'] = $mediaUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.CreateMessageInteractionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php000064400000003341150364341760024314 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php000064400000005735150364341760025075 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php000064400000014321150364341760025204 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php000064400000016347150364341760024365 0ustar00solution = [ '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'] ); } /** * Reads MessageInteractionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInteractionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams MessageInteractionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInteractionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessageInteractionPage Page of MessageInteractionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessageInteractionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessageInteractionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInteractionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessageInteractionPage Page of MessageInteractionInstance */ public function getPage(string $targetUrl): MessageInteractionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessageInteractionPage($this->version, $response, $this->solution); } /** * Constructs a MessageInteractionContext * * @param string $sid The Twilio-provided string that uniquely identifies the MessageInteraction resource to fetch. */ public function getContext( string $sid ): MessageInteractionContext { return new MessageInteractionContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['participantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy.V1.MessageInteractionList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php000064400000012767150364341760021434 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'sessionSid' => Values::array_get($payload, 'session_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identifier' => Values::array_get($payload, 'identifier'), 'proxyIdentifier' => Values::array_get($payload, 'proxy_identifier'), 'proxyIdentifierSid' => Values::array_get($payload, 'proxy_identifier_sid'), 'dateDeleted' => Deserialize::dateTime(Values::array_get($payload, 'date_deleted')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ParticipantContext Context for this ParticipantInstance */ protected function proxy(): ParticipantContext { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ParticipantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Access the messageInteractions */ protected function getMessageInteractions(): MessageInteractionList { return $this->proxy()->messageInteractions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php000064400000003174150364341760020534 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php000064400000010070150364341760021304 0ustar00options['friendlyName'] = $friendlyName; $this->options['proxyIdentifier'] = $proxyIdentifier; $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; } /** * The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** * * @param string $friendlyName The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool. * * @param string $proxyIdentifier The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool. * @return $this Fluent Builder */ public function setProxyIdentifier(string $proxyIdentifier): self { $this->options['proxyIdentifier'] = $proxyIdentifier; return $this; } /** * The SID of the Proxy Identifier to assign to the Participant. * * @param string $proxyIdentifierSid The SID of the Proxy Identifier to assign to the Participant. * @return $this Fluent Builder */ public function setProxyIdentifierSid(string $proxyIdentifierSid): self { $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.CreateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php000064400000005626150364341760021311 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Sessions/' . \rawurlencode($sessionSid) .'/Interactions/' . \rawurlencode($sid) .''; } /** * Delete the InteractionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php000064400000014072150364341760021424 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'sessionSid' => Values::array_get($payload, 'session_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'data' => Values::array_get($payload, 'data'), 'type' => Values::array_get($payload, 'type'), 'inboundParticipantSid' => Values::array_get($payload, 'inbound_participant_sid'), 'inboundResourceSid' => Values::array_get($payload, 'inbound_resource_sid'), 'inboundResourceStatus' => Values::array_get($payload, 'inbound_resource_status'), 'inboundResourceType' => Values::array_get($payload, 'inbound_resource_type'), 'inboundResourceUrl' => Values::array_get($payload, 'inbound_resource_url'), 'outboundParticipantSid' => Values::array_get($payload, 'outbound_participant_sid'), 'outboundResourceSid' => Values::array_get($payload, 'outbound_resource_sid'), 'outboundResourceStatus' => Values::array_get($payload, 'outbound_resource_status'), 'outboundResourceType' => Values::array_get($payload, 'outbound_resource_type'), 'outboundResourceUrl' => Values::array_get($payload, 'outbound_resource_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InteractionContext Context for this InteractionInstance */ protected function proxy(): InteractionContext { if (!$this->context) { $this->context = new InteractionContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InteractionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InteractionInstance * * @return InteractionInstance Fetched InteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InteractionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.InteractionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php000064400000013474150364341760020600 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Sessions/' . \rawurlencode($sessionSid) .'/Interactions'; } /** * Reads InteractionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InteractionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InteractionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InteractionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InteractionPage Page of InteractionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InteractionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InteractionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InteractionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InteractionPage Page of InteractionInstance */ public function getPage(string $targetUrl): InteractionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InteractionPage($this->version, $response, $this->solution); } /** * Constructs a InteractionContext * * @param string $sid The Twilio-provided string that uniquely identifies the Interaction resource to delete. */ public function getContext( string $sid ): InteractionContext { return new InteractionContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy.V1.InteractionList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php000064400000003174150364341760020535 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php000064400000015555150364341760020601 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Sessions/' . \rawurlencode($sessionSid) .'/Participants'; } /** * Create the ParticipantInstance * * @param string $identifier The phone number of the Participant. * @param array|Options $options Optional Arguments * @return ParticipantInstance Created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identifier, array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'Identifier' => $identifier, 'FriendlyName' => $options['friendlyName'], 'ProxyIdentifier' => $options['proxyIdentifier'], 'ProxyIdentifierSid' => $options['proxyIdentifierSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'] ); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid The Twilio-provided string that uniquely identifies the Participant resource to delete. */ public function getContext( string $sid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionInstance.php000064400000014140150364341760017141 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateStarted' => Deserialize::dateTime(Values::array_get($payload, 'date_started')), 'dateEnded' => Deserialize::dateTime(Values::array_get($payload, 'date_ended')), 'dateLastInteraction' => Deserialize::dateTime(Values::array_get($payload, 'date_last_interaction')), 'dateExpiry' => Deserialize::dateTime(Values::array_get($payload, 'date_expiry')), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'status' => Values::array_get($payload, 'status'), 'closedReason' => Values::array_get($payload, 'closed_reason'), 'ttl' => Values::array_get($payload, 'ttl'), 'mode' => Values::array_get($payload, 'mode'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SessionContext Context for this SessionInstance */ protected function proxy(): SessionContext { if (!$this->context) { $this->context = new SessionContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SessionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SessionInstance * * @return SessionInstance Fetched SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SessionInstance { return $this->proxy()->fetch(); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SessionInstance { return $this->proxy()->update($options); } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the interactions */ protected function getInteractions(): InteractionList { return $this->proxy()->interactions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.SessionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/ServiceOptions.php000064400000050475150364341760015420 0ustar00options['defaultTtl'] = $defaultTtl; $this->options['callbackUrl'] = $callbackUrl; $this->options['geoMatchLevel'] = $geoMatchLevel; $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; $this->options['chatInstanceSid'] = $chatInstanceSid; } /** * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. * * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. * @return $this Fluent Builder */ public function setDefaultTtl(int $defaultTtl): self { $this->options['defaultTtl'] = $defaultTtl; return $this; } /** * The URL we should call when the interaction status changes. * * @param string $callbackUrl The URL we should call when the interaction status changes. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * @param string $geoMatchLevel * @return $this Fluent Builder */ public function setGeoMatchLevel(string $geoMatchLevel): self { $this->options['geoMatchLevel'] = $geoMatchLevel; return $this; } /** * @param string $numberSelectionBehavior * @return $this Fluent Builder */ public function setNumberSelectionBehavior(string $numberSelectionBehavior): self { $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; return $this; } /** * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. * * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. * @return $this Fluent Builder */ public function setInterceptCallbackUrl(string $interceptCallbackUrl): self { $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; return $this; } /** * The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * @return $this Fluent Builder */ public function setOutOfSessionCallbackUrl(string $outOfSessionCallbackUrl): self { $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; return $this; } /** * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. * * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. * @return $this Fluent Builder */ public function setChatInstanceSid(string $chatInstanceSid): self { $this->options['chatInstanceSid'] = $chatInstanceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. * @param string $callbackUrl The URL we should call when the interaction status changes. * @param string $geoMatchLevel * @param string $numberSelectionBehavior * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. */ public function __construct( string $uniqueName = Values::NONE, int $defaultTtl = Values::INT_NONE, string $callbackUrl = Values::NONE, string $geoMatchLevel = Values::NONE, string $numberSelectionBehavior = Values::NONE, string $interceptCallbackUrl = Values::NONE, string $outOfSessionCallbackUrl = Values::NONE, string $chatInstanceSid = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['defaultTtl'] = $defaultTtl; $this->options['callbackUrl'] = $callbackUrl; $this->options['geoMatchLevel'] = $geoMatchLevel; $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; $this->options['chatInstanceSid'] = $chatInstanceSid; } /** * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. * * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. * @return $this Fluent Builder */ public function setDefaultTtl(int $defaultTtl): self { $this->options['defaultTtl'] = $defaultTtl; return $this; } /** * The URL we should call when the interaction status changes. * * @param string $callbackUrl The URL we should call when the interaction status changes. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * @param string $geoMatchLevel * @return $this Fluent Builder */ public function setGeoMatchLevel(string $geoMatchLevel): self { $this->options['geoMatchLevel'] = $geoMatchLevel; return $this; } /** * @param string $numberSelectionBehavior * @return $this Fluent Builder */ public function setNumberSelectionBehavior(string $numberSelectionBehavior): self { $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; return $this; } /** * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. * * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. * @return $this Fluent Builder */ public function setInterceptCallbackUrl(string $interceptCallbackUrl): self { $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; return $this; } /** * The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/en-us/serverless/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * @return $this Fluent Builder */ public function setOutOfSessionCallbackUrl(string $outOfSessionCallbackUrl): self { $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; return $this; } /** * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. * * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. * @return $this Fluent Builder */ public function setChatInstanceSid(string $chatInstanceSid): self { $this->options['chatInstanceSid'] = $chatInstanceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Proxy.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/ServiceList.php000064400000015027150364341760014672 0ustar00solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'DefaultTtl' => $options['defaultTtl'], 'CallbackUrl' => $options['callbackUrl'], 'GeoMatchLevel' => $options['geoMatchLevel'], 'NumberSelectionBehavior' => $options['numberSelectionBehavior'], 'InterceptCallbackUrl' => $options['interceptCallbackUrl'], 'OutOfSessionCallbackUrl' => $options['outOfSessionCallbackUrl'], 'ChatInstanceSid' => $options['chatInstanceSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Proxy.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Proxy/V1/ServicePage.php000064400000003006150364341760014625 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Proxy/V1/ServiceContext.php000064400000014261150364341760015402 0ustar00solution = [ '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([ '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 phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList( $this->version, $this->solution['sid'] ); } return $this->_phoneNumbers; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList( $this->version, $this->solution['sid'] ); } return $this->_shortCodes; } /** * Access the sessions */ protected function getSessions(): SessionList { if (!$this->_sessions) { $this->_sessions = new SessionList( $this->version, $this->solution['sid'] ); } return $this->_sessions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/ServiceInstance.php000064400000013635150364341760015526 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatInstanceSid' => Values::array_get($payload, 'chat_instance_sid'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'defaultTtl' => Values::array_get($payload, 'default_ttl'), 'numberSelectionBehavior' => Values::array_get($payload, 'number_selection_behavior'), 'geoMatchLevel' => Values::array_get($payload, 'geo_match_level'), 'interceptCallbackUrl' => Values::array_get($payload, 'intercept_callback_url'), 'outOfSessionCallbackUrl' => Values::array_get($payload, 'out_of_session_callback_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { return $this->proxy()->phoneNumbers; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { return $this->proxy()->shortCodes; } /** * Access the sessions */ protected function getSessions(): SessionList { return $this->proxy()->sessions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessagingBase.php000064400000005251150364341760014026 0ustar00baseUrl = 'https://ip-messaging.twilio.com'; } /** * @return V1 Version v1 of ip-messaging */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of ip-messaging */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging]'; } } sdk/src/Twilio/Rest/Media/V1.php000064400000006754150364341760012343 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamerPage.php000064400000003060150364341760016062 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Media/V1/MediaProcessorInstance.php000064400000011316150364341760016735 0ustar00properties = [ '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 * @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) . ']'; } } sdk/src/Twilio/Rest/Media/V1/MediaRecordingOptions.php000064400000010303150364341760016554 0ustar00options['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 by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. * @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, with possible values `processing`, `completed`, `deleted`, or `failed`. * @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 SID of a 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 SID of a MediaRecording source 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 . ']'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamerList.php000064400000015022150364341760016122 0ustar00solution = [ ]; $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 ); } /** * 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); } /** * 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']); } /** * Retrieve a single page of PlayerStreamerInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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 of the PlayerStreamer 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]'; } } sdk/src/Twilio/Rest/Media/V1/MediaProcessorContext.php000064400000005153150364341760016617 0ustar00solution = [ '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 * @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) . ']'; } } sdk/src/Twilio/Rest/Media/V1/MediaProcessorList.php000064400000016137150364341760016112 0ustar00solution = [ ]; $this->uri = '/MediaProcessors'; } /** * Create the MediaProcessorInstance * * @param string $extension The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` * @param string $extensionContext The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send. * @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 ); } /** * 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); } /** * 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']); } /** * Retrieve a single page of MediaProcessorInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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 of the MediaProcessor 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]'; } } sdk/src/Twilio/Rest/Media/V1/MediaProcessorPage.php000064400000003060150364341760016042 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Media/V1/MediaProcessorOptions.php000064400000022005150364341760016621 0ustar00options['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/media-extensions-overview) you are using for more information about whether you need to provide this. * * @param array $extensionEnvironment 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/media-extensions-overview) you are using for more information about whether you need to provide this. * @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/api/status-callbacks) for details. * * @param string $statusCallback The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. * @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. Can be `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The 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 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. * @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 by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. * @param string $status Status to filter by, with possible values `started`, `ended` or `failed`. */ 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 by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. * @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, with possible values `started`, `ended` or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Media.V1.ReadMediaProcessorOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantInstance.php000064400000007703150364341760021504 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantPage.php000064400000003140150364341760020603 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantContext.php000064400000005564150364341760021367 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantList.php000064400000003133150364341760020644 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantOptions.php000064400000006176150364341760021376 0ustar00options['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. Default value is 15 seconds. Maximum value is 60 seconds. * @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 origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. * @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 . ']'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamerInstance.php000064400000011633150364341760016757 0ustar00properties = [ '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 * @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) . ']'; } } sdk/src/Twilio/Rest/Media/V1/MediaRecordingPage.php000064400000003060150364341760015777 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamerOptions.php000064400000020345150364341760016646 0ustar00options['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 Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. * @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/api/status-callbacks) for more details. * * @param string $statusCallback The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. * @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. Can be `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The 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 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. * @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 by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. * @param string $status Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. */ 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 by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. * @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, with possible values `created`, `started`, `ended`, or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Media.V1.ReadPlayerStreamerOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Media/V1/MediaRecordingInstance.php000064400000011610150364341760016667 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Media/V1/PlayerStreamerContext.php000064400000010471150364341760016636 0ustar00solution = [ '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 * @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) . ']'; } } sdk/src/Twilio/Rest/Media/V1/MediaRecordingContext.php000064400000004440150364341760016552 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Media/V1/MediaRecordingList.php000064400000013314150364341760016041 0ustar00solution = [ ]; $this->uri = '/MediaRecordings'; } /** * 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); } /** * 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']); } /** * Retrieve a single page of MediaRecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, 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 of the MediaRecording resource to delete. */ 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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1.php000064400000005145150364341760013460 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php000064400000024146150364341760016765 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($sid) .''; } /** * Delete the WorkspaceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the taskQueues */ protected function getTaskQueues(): TaskQueueList { if (!$this->_taskQueues) { $this->_taskQueues = new TaskQueueList( $this->version, $this->solution['sid'] ); } return $this->_taskQueues; } /** * Access the events */ protected function getEvents(): EventList { if (!$this->_events) { $this->_events = new EventList( $this->version, $this->solution['sid'] ); } return $this->_events; } /** * Access the taskChannels */ protected function getTaskChannels(): TaskChannelList { if (!$this->_taskChannels) { $this->_taskChannels = new TaskChannelList( $this->version, $this->solution['sid'] ); } return $this->_taskChannels; } /** * Access the activities */ protected function getActivities(): ActivityList { if (!$this->_activities) { $this->_activities = new ActivityList( $this->version, $this->solution['sid'] ); } return $this->_activities; } /** * Access the workers */ protected function getWorkers(): WorkerList { if (!$this->_workers) { $this->_workers = new WorkerList( $this->version, $this->solution['sid'] ); } return $this->_workers; } /** * Access the workflows */ protected function getWorkflows(): WorkflowList { if (!$this->_workflows) { $this->_workflows = new WorkflowList( $this->version, $this->solution['sid'] ); } return $this->_workflows; } /** * Access the tasks */ protected function getTasks(): TaskList { if (!$this->_tasks) { $this->_tasks = new TaskList( $this->version, $this->solution['sid'] ); } return $this->_tasks; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkspaceCumulativeStatisticsList { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new WorkspaceCumulativeStatisticsList( $this->version, $this->solution['sid'] ); } return $this->_cumulativeStatistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkspaceRealTimeStatisticsList { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkspaceRealTimeStatisticsList( $this->version, $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * Access the statistics */ protected function getStatistics(): WorkspaceStatisticsList { if (!$this->_statistics) { $this->_statistics = new WorkspaceStatisticsList( $this->version, $this->solution['sid'] ); } return $this->_statistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspacePage.php000064400000003046150364341760016211 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php000064400000017500150364341760017101 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultActivityName' => Values::array_get($payload, 'default_activity_name'), 'defaultActivitySid' => Values::array_get($payload, 'default_activity_sid'), 'eventCallbackUrl' => Values::array_get($payload, 'event_callback_url'), 'eventsFilter' => Values::array_get($payload, 'events_filter'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'multiTaskEnabled' => Values::array_get($payload, 'multi_task_enabled'), 'sid' => Values::array_get($payload, 'sid'), 'timeoutActivityName' => Values::array_get($payload, 'timeout_activity_name'), 'timeoutActivitySid' => Values::array_get($payload, 'timeout_activity_sid'), 'prioritizeQueueOrder' => Values::array_get($payload, 'prioritize_queue_order'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WorkspaceContext Context for this WorkspaceInstance */ protected function proxy(): WorkspaceContext { if (!$this->context) { $this->context = new WorkspaceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the WorkspaceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WorkspaceInstance * * @return WorkspaceInstance Fetched WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WorkspaceInstance { return $this->proxy()->fetch(); } /** * Update the WorkspaceInstance * * @param array|Options $options Optional Arguments * @return WorkspaceInstance Updated WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WorkspaceInstance { return $this->proxy()->update($options); } /** * Access the taskQueues */ protected function getTaskQueues(): TaskQueueList { return $this->proxy()->taskQueues; } /** * Access the events */ protected function getEvents(): EventList { return $this->proxy()->events; } /** * Access the taskChannels */ protected function getTaskChannels(): TaskChannelList { return $this->proxy()->taskChannels; } /** * Access the activities */ protected function getActivities(): ActivityList { return $this->proxy()->activities; } /** * Access the workers */ protected function getWorkers(): WorkerList { return $this->proxy()->workers; } /** * Access the workflows */ protected function getWorkflows(): WorkflowList { return $this->proxy()->workflows; } /** * Access the tasks */ protected function getTasks(): TaskList { return $this->proxy()->tasks; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkspaceCumulativeStatisticsList { return $this->proxy()->cumulativeStatistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkspaceRealTimeStatisticsList { return $this->proxy()->realTimeStatistics; } /** * Access the statistics */ protected function getStatistics(): WorkspaceStatisticsList { return $this->proxy()->statistics; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php000064400000055577150364341760017010 0ustar00options['eventCallbackUrl'] = $eventCallbackUrl; $this->options['eventsFilter'] = $eventsFilter; $this->options['multiTaskEnabled'] = $multiTaskEnabled; $this->options['template'] = $template; $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; } /** * The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). * * @param string $eventCallbackUrl The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). * @return $this Fluent Builder */ public function setEventCallbackUrl(string $eventCallbackUrl): self { $this->options['eventCallbackUrl'] = $eventCallbackUrl; return $this; } /** * The list of Workspace events for which to call event_callback_url. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. * * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. * @return $this Fluent Builder */ public function setEventsFilter(string $eventsFilter): self { $this->options['eventsFilter'] = $eventsFilter; return $this; } /** * Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be created as multi-tasking. The default is `true`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). * * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be created as multi-tasking. The default is `true`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). * @return $this Fluent Builder */ public function setMultiTaskEnabled(bool $multiTaskEnabled): self { $this->options['multiTaskEnabled'] = $multiTaskEnabled; return $this; } /** * An available template name. Can be: `NONE` or `FIFO` and the default is `NONE`. Pre-configures the Workspace with the Workflow and Activities specified in the template. `NONE` will create a Workspace with only a set of default activities. `FIFO` will configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter. * * @param string $template An available template name. Can be: `NONE` or `FIFO` and the default is `NONE`. Pre-configures the Workspace with the Workflow and Activities specified in the template. `NONE` will create a Workspace with only a set of default activities. `FIFO` will configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter. * @return $this Fluent Builder */ public function setTemplate(string $template): self { $this->options['template'] = $template; return $this; } /** * @param string $prioritizeQueueOrder * @return $this Fluent Builder */ public function setPrioritizeQueueOrder(string $prioritizeQueueOrder): self { $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.CreateWorkspaceOptions ' . $options . ']'; } } class ReadWorkspaceOptions extends Options { /** * @param string $friendlyName The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. * * @param string $friendlyName The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadWorkspaceOptions ' . $options . ']'; } } class UpdateWorkspaceOptions extends Options { /** * @param string $defaultActivitySid The SID of the Activity that will be used when new Workers are created in the Workspace. * @param string $eventCallbackUrl The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). * @param string $timeoutActivitySid The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. * @param string $prioritizeQueueOrder */ public function __construct( string $defaultActivitySid = Values::NONE, string $eventCallbackUrl = Values::NONE, string $eventsFilter = Values::NONE, string $friendlyName = Values::NONE, bool $multiTaskEnabled = Values::BOOL_NONE, string $timeoutActivitySid = Values::NONE, string $prioritizeQueueOrder = Values::NONE ) { $this->options['defaultActivitySid'] = $defaultActivitySid; $this->options['eventCallbackUrl'] = $eventCallbackUrl; $this->options['eventsFilter'] = $eventsFilter; $this->options['friendlyName'] = $friendlyName; $this->options['multiTaskEnabled'] = $multiTaskEnabled; $this->options['timeoutActivitySid'] = $timeoutActivitySid; $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; } /** * The SID of the Activity that will be used when new Workers are created in the Workspace. * * @param string $defaultActivitySid The SID of the Activity that will be used when new Workers are created in the Workspace. * @return $this Fluent Builder */ public function setDefaultActivitySid(string $defaultActivitySid): self { $this->options['defaultActivitySid'] = $defaultActivitySid; return $this; } /** * The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). * * @param string $eventCallbackUrl The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). * @return $this Fluent Builder */ public function setEventCallbackUrl(string $eventCallbackUrl): self { $this->options['eventCallbackUrl'] = $eventCallbackUrl; return $this; } /** * The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. * * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. * @return $this Fluent Builder */ public function setEventsFilter(string $eventsFilter): self { $this->options['eventsFilter'] = $eventsFilter; return $this; } /** * A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. * * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). * * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). * @return $this Fluent Builder */ public function setMultiTaskEnabled(bool $multiTaskEnabled): self { $this->options['multiTaskEnabled'] = $multiTaskEnabled; return $this; } /** * The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. * * @param string $timeoutActivitySid The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. * @return $this Fluent Builder */ public function setTimeoutActivitySid(string $timeoutActivitySid): self { $this->options['timeoutActivitySid'] = $timeoutActivitySid; return $this; } /** * @param string $prioritizeQueueOrder * @return $this Fluent Builder */ public function setPrioritizeQueueOrder(string $prioritizeQueueOrder): self { $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.UpdateWorkspaceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceList.php000064400000015356150364341760016257 0ustar00solution = [ ]; $this->uri = '/Workspaces'; } /** * Create the WorkspaceInstance * * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. It can be up to 64 characters long. For example: `Customer Support` or `2014 Election Campaign`. * @param array|Options $options Optional Arguments * @return WorkspaceInstance Created WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): WorkspaceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'EventCallbackUrl' => $options['eventCallbackUrl'], 'EventsFilter' => $options['eventsFilter'], 'MultiTaskEnabled' => Serialize::booleanToString($options['multiTaskEnabled']), 'Template' => $options['template'], 'PrioritizeQueueOrder' => $options['prioritizeQueueOrder'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WorkspaceInstance( $this->version, $payload ); } /** * Reads WorkspaceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WorkspaceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams WorkspaceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WorkspaceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WorkspacePage Page of WorkspaceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WorkspacePage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WorkspacePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WorkspaceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WorkspacePage Page of WorkspaceInstance */ public function getPage(string $targetUrl): WorkspacePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WorkspacePage($this->version, $response, $this->solution); } /** * Constructs a WorkspaceContext * * @param string $sid The SID of the Workspace resource to delete. */ public function getContext( string $sid ): WorkspaceContext { return new WorkspaceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.WorkspaceList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php000064400000014540150364341760017332 0ustar00solution = [ 'workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Events'; } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EventPage Page of EventInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EventPage { $options = new Values($options); $params = Values::of([ 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'EventType' => $options['eventType'], 'Minutes' => $options['minutes'], 'ReservationSid' => $options['reservationSid'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskQueueSid' => $options['taskQueueSid'], 'TaskSid' => $options['taskSid'], 'WorkerSid' => $options['workerSid'], 'WorkflowSid' => $options['workflowSid'], 'TaskChannel' => $options['taskChannel'], 'Sid' => $options['sid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EventPage Page of EventInstance */ public function getPage(string $targetUrl): EventPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Constructs a EventContext * * @param string $sid The SID of the Event resource to fetch. */ public function getContext( string $sid ): EventContext { return new EventContext( $this->version, $this->solution['workspaceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.EventList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php000064400000003323150364341760024257 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php000064400000015677150364341760020610 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Workflows/' . \rawurlencode($sid) .''; } /** * Delete the WorkflowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the statistics */ protected function getStatistics(): WorkflowStatisticsList { if (!$this->_statistics) { $this->_statistics = new WorkflowStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkflowCumulativeStatisticsList { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new WorkflowCumulativeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_cumulativeStatistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkflowRealTimeStatisticsList { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkflowRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php000064400000020374150364341760020235 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Workers/' . \rawurlencode($sid) .''; } /** * Delete the WorkerInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the WorkerInstance * * @return WorkerInstance Fetched WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WorkerInstance { $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'] ); } /** * Access the workerChannels */ protected function getWorkerChannels(): WorkerChannelList { if (!$this->_workerChannels) { $this->_workerChannels = new WorkerChannelList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_workerChannels; } /** * Access the reservations */ protected function getReservations(): ReservationList { if (!$this->_reservations) { $this->_reservations = new ReservationList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_reservations; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkersRealTimeStatisticsList { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkersRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * Access the statistics */ protected function getStatistics(): WorkerStatisticsList { if (!$this->_statistics) { $this->_statistics = new WorkerStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkersCumulativeStatisticsList { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new WorkersCumulativeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_cumulativeStatistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php000064400000004275150364341760020047 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php000064400000005463150364341760025036 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php000064400000015671150364341760020677 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/TaskQueues/' . \rawurlencode($sid) .''; } /** * Delete the TaskQueueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): TaskQueueCumulativeStatisticsList { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new TaskQueueCumulativeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_cumulativeStatistics; } /** * Access the statistics */ protected function getStatistics(): TaskQueueStatisticsList { if (!$this->_statistics) { $this->_statistics = new TaskQueueStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): TaskQueueRealTimeStatisticsList { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new TaskQueueRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php000064400000003133150364341760020115 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php000064400000014401150364341760020710 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assignmentCallbackUrl' => Values::array_get($payload, 'assignment_callback_url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'documentContentType' => Values::array_get($payload, 'document_content_type'), 'fallbackAssignmentCallbackUrl' => Values::array_get($payload, 'fallback_assignment_callback_url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'taskReservationTimeout' => Values::array_get($payload, 'task_reservation_timeout'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WorkflowContext Context for this WorkflowInstance */ protected function proxy(): WorkflowContext { if (!$this->context) { $this->context = new WorkflowContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WorkflowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WorkflowInstance * * @return WorkflowInstance Fetched WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WorkflowInstance { return $this->proxy()->fetch(); } /** * Update the WorkflowInstance * * @param array|Options $options Optional Arguments * @return WorkflowInstance Updated WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WorkflowInstance { return $this->proxy()->update($options); } /** * Access the statistics */ protected function getStatistics(): WorkflowStatisticsList { return $this->proxy()->statistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkflowCumulativeStatisticsList { return $this->proxy()->cumulativeStatistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkflowRealTimeStatisticsList { return $this->proxy()->realTimeStatistics; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php000064400000003147150364341760020406 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php000064400000006374150364341760020564 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Activities/' . \rawurlencode($sid) .''; } /** * Delete the ActivityInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php000064400000004707150364341760024422 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php000064400000003075150364341760017115 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php000064400000017454150364341760020574 0ustar00options['available'] = $available; } /** * Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. The value cannot be changed after the Activity is created. * * @param bool $available Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. The value cannot be changed after the Activity is created. * @return $this Fluent Builder */ public function setAvailable(bool $available): self { $this->options['available'] = $available; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.CreateActivityOptions ' . $options . ']'; } } class ReadActivityOptions extends Options { /** * @param string $friendlyName The `friendly_name` of the Activity resources to read. * @param string $available Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. */ public function __construct( string $friendlyName = Values::NONE, string $available = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['available'] = $available; } /** * The `friendly_name` of the Activity resources to read. * * @param string $friendlyName The `friendly_name` of the Activity resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. * * @param string $available Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. * @return $this Fluent Builder */ public function setAvailable(string $available): self { $this->options['available'] = $available; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadActivityOptions ' . $options . ']'; } } class UpdateActivityOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. * * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.UpdateActivityOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php000064400000016513150364341760017155 0ustar00solution = [ 'workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Tasks'; } /** * Create the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Created TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): TaskInstance { $options = new Values($options); $data = Values::of([ 'Timeout' => $options['timeout'], 'Priority' => $options['priority'], 'TaskChannel' => $options['taskChannel'], 'WorkflowSid' => $options['workflowSid'], 'Attributes' => $options['attributes'], 'VirtualStartTime' => Serialize::iso8601DateTime($options['virtualStartTime']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Reads TaskInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TaskInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TaskInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TaskPage Page of TaskInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TaskPage { $options = new Values($options); $params = Values::of([ 'Priority' => $options['priority'], 'AssignmentStatus' => Serialize::map($options['assignmentStatus'], function ($e) { return $e; }), 'WorkflowSid' => $options['workflowSid'], 'WorkflowName' => $options['workflowName'], 'TaskQueueSid' => $options['taskQueueSid'], 'TaskQueueName' => $options['taskQueueName'], 'EvaluateTaskAttributes' => $options['evaluateTaskAttributes'], 'Ordering' => $options['ordering'], 'HasAddons' => Serialize::booleanToString($options['hasAddons']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TaskPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TaskPage Page of TaskInstance */ public function getPage(string $targetUrl): TaskPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskPage($this->version, $response, $this->solution); } /** * Constructs a TaskContext * * @param string $sid The SID of the Task resource to delete. */ public function getContext( string $sid ): TaskContext { return new TaskContext( $this->version, $this->solution['workspaceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.TaskList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php000064400000033570150364341760020607 0ustar00options['assignmentCallbackUrl'] = $assignmentCallbackUrl; $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; $this->options['taskReservationTimeout'] = $taskReservationTimeout; } /** * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. * * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. * @return $this Fluent Builder */ public function setAssignmentCallbackUrl(string $assignmentCallbackUrl): self { $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; return $this; } /** * The URL that we should call when a call to the `assignment_callback_url` fails. * * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. * @return $this Fluent Builder */ public function setFallbackAssignmentCallbackUrl(string $fallbackAssignmentCallbackUrl): self { $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; return $this; } /** * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. * * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. * @return $this Fluent Builder */ public function setTaskReservationTimeout(int $taskReservationTimeout): self { $this->options['taskReservationTimeout'] = $taskReservationTimeout; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.CreateWorkflowOptions ' . $options . ']'; } } class ReadWorkflowOptions extends Options { /** * @param string $friendlyName The `friendly_name` of the Workflow resources to read. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * The `friendly_name` of the Workflow resources to read. * * @param string $friendlyName The `friendly_name` of the Workflow resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadWorkflowOptions ' . $options . ']'; } } class UpdateWorkflowOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. */ public function __construct( string $friendlyName = Values::NONE, string $assignmentCallbackUrl = Values::NONE, string $fallbackAssignmentCallbackUrl = Values::NONE, string $configuration = Values::NONE, int $taskReservationTimeout = Values::INT_NONE, string $reEvaluateTasks = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; $this->options['configuration'] = $configuration; $this->options['taskReservationTimeout'] = $taskReservationTimeout; $this->options['reEvaluateTasks'] = $reEvaluateTasks; } /** * A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. * * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. * * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. * @return $this Fluent Builder */ public function setAssignmentCallbackUrl(string $assignmentCallbackUrl): self { $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; return $this; } /** * The URL that we should call when a call to the `assignment_callback_url` fails. * * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. * @return $this Fluent Builder */ public function setFallbackAssignmentCallbackUrl(string $fallbackAssignmentCallbackUrl): self { $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; return $this; } /** * A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. * * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. * @return $this Fluent Builder */ public function setConfiguration(string $configuration): self { $this->options['configuration'] = $configuration; return $this; } /** * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. * * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. * @return $this Fluent Builder */ public function setTaskReservationTimeout(int $taskReservationTimeout): self { $this->options['taskReservationTimeout'] = $taskReservationTimeout; return $this; } /** * Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. * * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. * @return $this Fluent Builder */ public function setReEvaluateTasks(string $reEvaluateTasks): self { $this->options['reEvaluateTasks'] = $reEvaluateTasks; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.UpdateWorkflowOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php000064400000015113150364341760020001 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'age' => Values::array_get($payload, 'age'), 'assignmentStatus' => Values::array_get($payload, 'assignment_status'), 'attributes' => Values::array_get($payload, 'attributes'), 'addons' => Values::array_get($payload, 'addons'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'taskQueueEnteredDate' => Deserialize::dateTime(Values::array_get($payload, 'task_queue_entered_date')), 'priority' => Values::array_get($payload, 'priority'), 'reason' => Values::array_get($payload, 'reason'), 'sid' => Values::array_get($payload, 'sid'), 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), 'taskQueueFriendlyName' => Values::array_get($payload, 'task_queue_friendly_name'), 'taskChannelSid' => Values::array_get($payload, 'task_channel_sid'), 'taskChannelUniqueName' => Values::array_get($payload, 'task_channel_unique_name'), 'timeout' => Values::array_get($payload, 'timeout'), 'workflowSid' => Values::array_get($payload, 'workflow_sid'), 'workflowFriendlyName' => Values::array_get($payload, 'workflow_friendly_name'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'virtualStartTime' => Deserialize::dateTime(Values::array_get($payload, 'virtual_start_time')), ]; $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskContext Context for this TaskInstance */ protected function proxy(): TaskContext { if (!$this->context) { $this->context = new TaskContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TaskInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskInstance { return $this->proxy()->fetch(); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskInstance { return $this->proxy()->update($options); } /** * Access the reservations */ protected function getReservations(): ReservationList { return $this->proxy()->reservations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php000064400000003125150364341760020003 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php000064400000042437150364341760020706 0ustar00options['targetWorkers'] = $targetWorkers; $this->options['maxReservedWorkers'] = $maxReservedWorkers; $this->options['taskOrder'] = $taskOrder; $this->options['reservationActivitySid'] = $reservationActivitySid; $this->options['assignmentActivitySid'] = $assignmentActivitySid; } /** * A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `'\\\"language\\\" == \\\"spanish\\\"'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). * * @param string $targetWorkers A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `'\\\"language\\\" == \\\"spanish\\\"'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). * @return $this Fluent Builder */ public function setTargetWorkers(string $targetWorkers): self { $this->options['targetWorkers'] = $targetWorkers; return $this; } /** * The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. * * @param int $maxReservedWorkers The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. * @return $this Fluent Builder */ public function setMaxReservedWorkers(int $maxReservedWorkers): self { $this->options['maxReservedWorkers'] = $maxReservedWorkers; return $this; } /** * @param string $taskOrder * @return $this Fluent Builder */ public function setTaskOrder(string $taskOrder): self { $this->options['taskOrder'] = $taskOrder; return $this; } /** * The SID of the Activity to assign Workers when a task is reserved for them. * * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. * @return $this Fluent Builder */ public function setReservationActivitySid(string $reservationActivitySid): self { $this->options['reservationActivitySid'] = $reservationActivitySid; return $this; } /** * The SID of the Activity to assign Workers when a task is assigned to them. * * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned to them. * @return $this Fluent Builder */ public function setAssignmentActivitySid(string $assignmentActivitySid): self { $this->options['assignmentActivitySid'] = $assignmentActivitySid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.CreateTaskQueueOptions ' . $options . ']'; } } class ReadTaskQueueOptions extends Options { /** * @param string $friendlyName The `friendly_name` of the TaskQueue resources to read. * @param string $evaluateWorkerAttributes The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. * @param string $workerSid The SID of the Worker with the TaskQueue resources to read. * @param string $ordering Sorting parameter for TaskQueues */ public function __construct( string $friendlyName = Values::NONE, string $evaluateWorkerAttributes = Values::NONE, string $workerSid = Values::NONE, string $ordering = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; $this->options['workerSid'] = $workerSid; $this->options['ordering'] = $ordering; } /** * The `friendly_name` of the TaskQueue resources to read. * * @param string $friendlyName The `friendly_name` of the TaskQueue resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. * * @param string $evaluateWorkerAttributes The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. * @return $this Fluent Builder */ public function setEvaluateWorkerAttributes(string $evaluateWorkerAttributes): self { $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; return $this; } /** * The SID of the Worker with the TaskQueue resources to read. * * @param string $workerSid The SID of the Worker with the TaskQueue resources to read. * @return $this Fluent Builder */ public function setWorkerSid(string $workerSid): self { $this->options['workerSid'] = $workerSid; return $this; } /** * Sorting parameter for TaskQueues * * @param string $ordering Sorting parameter for TaskQueues * @return $this Fluent Builder */ public function setOrdering(string $ordering): self { $this->options['ordering'] = $ordering; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadTaskQueueOptions ' . $options . ']'; } } class UpdateTaskQueueOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. * @param string $targetWorkers A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned for them. * @param int $maxReservedWorkers The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. * @param string $taskOrder */ public function __construct( string $friendlyName = Values::NONE, string $targetWorkers = Values::NONE, string $reservationActivitySid = Values::NONE, string $assignmentActivitySid = Values::NONE, int $maxReservedWorkers = Values::INT_NONE, string $taskOrder = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['targetWorkers'] = $targetWorkers; $this->options['reservationActivitySid'] = $reservationActivitySid; $this->options['assignmentActivitySid'] = $assignmentActivitySid; $this->options['maxReservedWorkers'] = $maxReservedWorkers; $this->options['taskOrder'] = $taskOrder; } /** * A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. * * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. * * @param string $targetWorkers A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. * @return $this Fluent Builder */ public function setTargetWorkers(string $targetWorkers): self { $this->options['targetWorkers'] = $targetWorkers; return $this; } /** * The SID of the Activity to assign Workers when a task is reserved for them. * * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. * @return $this Fluent Builder */ public function setReservationActivitySid(string $reservationActivitySid): self { $this->options['reservationActivitySid'] = $reservationActivitySid; return $this; } /** * The SID of the Activity to assign Workers when a task is assigned for them. * * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned for them. * @return $this Fluent Builder */ public function setAssignmentActivitySid(string $assignmentActivitySid): self { $this->options['assignmentActivitySid'] = $assignmentActivitySid; return $this; } /** * The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. * * @param int $maxReservedWorkers The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. * @return $this Fluent Builder */ public function setMaxReservedWorkers(int $maxReservedWorkers): self { $this->options['maxReservedWorkers'] = $maxReservedWorkers; return $this; } /** * @param string $taskOrder * @return $this Fluent Builder */ public function setTaskOrder(string $taskOrder): self { $this->options['taskOrder'] = $taskOrder; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.UpdateTaskQueueOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php000064400000046363150364341760020252 0ustar00options['activitySid'] = $activitySid; $this->options['attributes'] = $attributes; } /** * The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. * * @param string $activitySid The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. * @return $this Fluent Builder */ public function setActivitySid(string $activitySid): self { $this->options['activitySid'] = $activitySid; return $this; } /** * A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. * * @param string $attributes A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.CreateWorkerOptions ' . $options . ']'; } } class DeleteWorkerOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.DeleteWorkerOptions ' . $options . ']'; } } class ReadWorkerOptions extends Options { /** * @param string $activityName The `activity_name` of the Worker resources to read. * @param string $activitySid The `activity_sid` of the Worker resources to read. * @param string $available Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. * @param string $friendlyName The `friendly_name` of the Worker resources to read. * @param string $targetWorkersExpression Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` * @param string $taskQueueName The `friendly_name` of the TaskQueue that the Workers to read are eligible for. * @param string $taskQueueSid The SID of the TaskQueue that the Workers to read are eligible for. * @param string $ordering Sorting parameter for Workers */ public function __construct( string $activityName = Values::NONE, string $activitySid = Values::NONE, string $available = Values::NONE, string $friendlyName = Values::NONE, string $targetWorkersExpression = Values::NONE, string $taskQueueName = Values::NONE, string $taskQueueSid = Values::NONE, string $ordering = Values::NONE ) { $this->options['activityName'] = $activityName; $this->options['activitySid'] = $activitySid; $this->options['available'] = $available; $this->options['friendlyName'] = $friendlyName; $this->options['targetWorkersExpression'] = $targetWorkersExpression; $this->options['taskQueueName'] = $taskQueueName; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['ordering'] = $ordering; } /** * The `activity_name` of the Worker resources to read. * * @param string $activityName The `activity_name` of the Worker resources to read. * @return $this Fluent Builder */ public function setActivityName(string $activityName): self { $this->options['activityName'] = $activityName; return $this; } /** * The `activity_sid` of the Worker resources to read. * * @param string $activitySid The `activity_sid` of the Worker resources to read. * @return $this Fluent Builder */ public function setActivitySid(string $activitySid): self { $this->options['activitySid'] = $activitySid; return $this; } /** * Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. * * @param string $available Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. * @return $this Fluent Builder */ public function setAvailable(string $available): self { $this->options['available'] = $available; return $this; } /** * The `friendly_name` of the Worker resources to read. * * @param string $friendlyName The `friendly_name` of the Worker resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` * * @param string $targetWorkersExpression Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` * @return $this Fluent Builder */ public function setTargetWorkersExpression(string $targetWorkersExpression): self { $this->options['targetWorkersExpression'] = $targetWorkersExpression; return $this; } /** * The `friendly_name` of the TaskQueue that the Workers to read are eligible for. * * @param string $taskQueueName The `friendly_name` of the TaskQueue that the Workers to read are eligible for. * @return $this Fluent Builder */ public function setTaskQueueName(string $taskQueueName): self { $this->options['taskQueueName'] = $taskQueueName; return $this; } /** * The SID of the TaskQueue that the Workers to read are eligible for. * * @param string $taskQueueSid The SID of the TaskQueue that the Workers to read are eligible for. * @return $this Fluent Builder */ public function setTaskQueueSid(string $taskQueueSid): self { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * Sorting parameter for Workers * * @param string $ordering Sorting parameter for Workers * @return $this Fluent Builder */ public function setOrdering(string $ordering): self { $this->options['ordering'] = $ordering; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadWorkerOptions ' . $options . ']'; } } class UpdateWorkerOptions extends Options { /** * @param string $activitySid The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. * @param string $attributes The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. * @param string $friendlyName A descriptive string that you create to describe the Worker. It can be up to 64 characters long. * @param bool $rejectPendingReservations Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $activitySid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, bool $rejectPendingReservations = Values::BOOL_NONE, string $ifMatch = Values::NONE ) { $this->options['activitySid'] = $activitySid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['rejectPendingReservations'] = $rejectPendingReservations; $this->options['ifMatch'] = $ifMatch; } /** * The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. * * @param string $activitySid The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. * @return $this Fluent Builder */ public function setActivitySid(string $activitySid): self { $this->options['activitySid'] = $activitySid; return $this; } /** * The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. * * @param string $attributes The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the Worker. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the Worker. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. * * @param bool $rejectPendingReservations Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. * @return $this Fluent Builder */ public function setRejectPendingReservations(bool $rejectPendingReservations): self { $this->options['rejectPendingReservations'] = $rejectPendingReservations; return $this; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.UpdateWorkerOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php000064400000013657150364341760025162 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php000064400000004643150364341760024430 0ustar00options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkspaceRealTimeStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php000064400000020571150364341760025042 0ustar00options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. * * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. * @return $this Fluent Builder */ public function setSplitByWaitTime(string $splitByWaitTime): self { $this->options['splitByWaitTime'] = $splitByWaitTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkspaceCumulativeStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php000064400000015265150364341760020360 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'activityName' => Values::array_get($payload, 'activity_name'), 'activitySid' => Values::array_get($payload, 'activity_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'available' => Values::array_get($payload, 'available'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateStatusChanged' => Deserialize::dateTime(Values::array_get($payload, 'date_status_changed')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WorkerContext Context for this WorkerInstance */ protected function proxy(): WorkerContext { if (!$this->context) { $this->context = new WorkerContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WorkerInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the WorkerInstance * * @return WorkerInstance Fetched WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WorkerInstance { return $this->proxy()->fetch(); } /** * Update the WorkerInstance * * @param array|Options $options Optional Arguments * @return WorkerInstance Updated WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WorkerInstance { return $this->proxy()->update($options); } /** * Access the workerChannels */ protected function getWorkerChannels(): WorkerChannelList { return $this->proxy()->workerChannels; } /** * Access the reservations */ protected function getReservations(): ReservationList { return $this->proxy()->reservations; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): WorkersRealTimeStatisticsList { return $this->proxy()->realTimeStatistics; } /** * Access the statistics */ protected function getStatistics(): WorkerStatisticsList { return $this->proxy()->statistics; } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): WorkersCumulativeStatisticsList { return $this->proxy()->cumulativeStatistics; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php000064400000011743150364341760021277 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'channelOptimizedRouting' => Values::array_get($payload, 'channel_optimized_routing'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskChannelContext Context for this TaskChannelInstance */ protected function proxy(): TaskChannelContext { if (!$this->context) { $this->context = new TaskChannelContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TaskChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TaskChannelInstance * * @return TaskChannelInstance Fetched TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskChannelInstance { return $this->proxy()->fetch(); } /** * Update the TaskChannelInstance * * @param array|Options $options Optional Arguments * @return TaskChannelInstance Updated TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskChannelInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php000064400000003162150364341760022260 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php000064400000015254150364341760020447 0ustar00solution = [ 'workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/TaskChannels'; } /** * Create the TaskChannelInstance * * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the Task Channel, such as `voice` or `sms`. * @param array|Options $options Optional Arguments * @return TaskChannelInstance Created TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $uniqueName, array $options = []): TaskChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'UniqueName' => $uniqueName, 'ChannelOptimizedRouting' => Serialize::booleanToString($options['channelOptimizedRouting']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskChannelInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Reads TaskChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TaskChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TaskChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TaskChannelPage Page of TaskChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TaskChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TaskChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TaskChannelPage Page of TaskChannelInstance */ public function getPage(string $targetUrl): TaskChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskChannelPage($this->version, $response, $this->solution); } /** * Constructs a TaskChannelContext * * @param string $sid The SID of the Task Channel resource to delete. */ public function getContext( string $sid ): TaskChannelContext { return new TaskChannelContext( $this->version, $this->solution['workspaceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.TaskChannelList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php000064400000006700150364341760021154 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/TaskChannels/' . \rawurlencode($sid) .''; } /** * Delete the TaskChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php000064400000003103150364341760017264 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php000064400000003125150364341760020021 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php000064400000077463150364341760017710 0ustar00options['timeout'] = $timeout; $this->options['priority'] = $priority; $this->options['taskChannel'] = $taskChannel; $this->options['workflowSid'] = $workflowSid; $this->options['attributes'] = $attributes; $this->options['virtualStartTime'] = $virtualStartTime; } /** * The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. * * @param int $timeout The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 2^31^ (2,147,483,647). * * @param int $priority The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 2^31^ (2,147,483,647). * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. * * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. * * @param string $workflowSid The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. * @return $this Fluent Builder */ public function setWorkflowSid(string $workflowSid): self { $this->options['workflowSid'] = $workflowSid; return $this; } /** * A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. * * @param string $attributes A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. * * @param \DateTime $virtualStartTime The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. * @return $this Fluent Builder */ public function setVirtualStartTime(\DateTime $virtualStartTime): self { $this->options['virtualStartTime'] = $virtualStartTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.CreateTaskOptions ' . $options . ']'; } } class DeleteTaskOptions extends Options { /** * @param string $ifMatch If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.DeleteTaskOptions ' . $options . ']'; } } class ReadTaskOptions extends Options { /** * @param int $priority The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. * @param string[] $assignmentStatus The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. * @param string $workflowSid The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. * @param string $workflowName The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. * @param string $taskQueueName The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. * @param string $evaluateTaskAttributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. * @param string $ordering How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. * @param bool $hasAddons Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. */ public function __construct( int $priority = Values::INT_NONE, array $assignmentStatus = Values::ARRAY_NONE, string $workflowSid = Values::NONE, string $workflowName = Values::NONE, string $taskQueueSid = Values::NONE, string $taskQueueName = Values::NONE, string $evaluateTaskAttributes = Values::NONE, string $ordering = Values::NONE, bool $hasAddons = Values::BOOL_NONE ) { $this->options['priority'] = $priority; $this->options['assignmentStatus'] = $assignmentStatus; $this->options['workflowSid'] = $workflowSid; $this->options['workflowName'] = $workflowName; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskQueueName'] = $taskQueueName; $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; $this->options['ordering'] = $ordering; $this->options['hasAddons'] = $hasAddons; } /** * The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. * * @param int $priority The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. * * @param string[] $assignmentStatus The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. * @return $this Fluent Builder */ public function setAssignmentStatus(array $assignmentStatus): self { $this->options['assignmentStatus'] = $assignmentStatus; return $this; } /** * The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. * * @param string $workflowSid The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. * @return $this Fluent Builder */ public function setWorkflowSid(string $workflowSid): self { $this->options['workflowSid'] = $workflowSid; return $this; } /** * The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. * * @param string $workflowName The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. * @return $this Fluent Builder */ public function setWorkflowName(string $workflowName): self { $this->options['workflowName'] = $workflowName; return $this; } /** * The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. * * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. * @return $this Fluent Builder */ public function setTaskQueueSid(string $taskQueueSid): self { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. * * @param string $taskQueueName The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. * @return $this Fluent Builder */ public function setTaskQueueName(string $taskQueueName): self { $this->options['taskQueueName'] = $taskQueueName; return $this; } /** * The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. * * @param string $evaluateTaskAttributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. * @return $this Fluent Builder */ public function setEvaluateTaskAttributes(string $evaluateTaskAttributes): self { $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; return $this; } /** * How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. * * @param string $ordering How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. * @return $this Fluent Builder */ public function setOrdering(string $ordering): self { $this->options['ordering'] = $ordering; return $this; } /** * Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. * * @param bool $hasAddons Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without 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 UpdateTaskOptions extends Options { /** * @param string $attributes The JSON string that describes the custom attributes of the task. * @param string $assignmentStatus * @param string $reason The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. * @param int $priority The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @param \DateTime $virtualStartTime The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. * @param string $ifMatch If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( string $attributes = Values::NONE, string $assignmentStatus = Values::NONE, string $reason = Values::NONE, int $priority = Values::INT_NONE, string $taskChannel = Values::NONE, \DateTime $virtualStartTime = null, string $ifMatch = Values::NONE ) { $this->options['attributes'] = $attributes; $this->options['assignmentStatus'] = $assignmentStatus; $this->options['reason'] = $reason; $this->options['priority'] = $priority; $this->options['taskChannel'] = $taskChannel; $this->options['virtualStartTime'] = $virtualStartTime; $this->options['ifMatch'] = $ifMatch; } /** * The JSON string that describes the custom attributes of the task. * * @param string $attributes The JSON string that describes the custom attributes of the task. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $assignmentStatus * @return $this Fluent Builder */ public function setAssignmentStatus(string $assignmentStatus): self { $this->options['assignmentStatus'] = $assignmentStatus; return $this; } /** * The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. * * @param string $reason The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. * @return $this Fluent Builder */ public function setReason(string $reason): self { $this->options['reason'] = $reason; return $this; } /** * The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). * * @param int $priority The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. * * @param \DateTime $virtualStartTime The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. * @return $this Fluent Builder */ public function setVirtualStartTime(\DateTime $virtualStartTime): self { $this->options['virtualStartTime'] = $virtualStartTime; return $this; } /** * If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.UpdateTaskOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php000064400000003227150364341760022223 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php000064400000010666150364341760024543 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php000064400000012400150364341760026407 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php000064400000016127150364341760026724 0ustar00options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default is 15 minutes. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold. * * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold. * @return $this Fluent Builder */ public function setSplitByWaitTime(string $splitByWaitTime): self { $this->options['splitByWaitTime'] = $splitByWaitTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchTaskQueueCumulativeStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php000064400000003261150364341760024264 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php000064400000003657150364341760026210 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php000064400000013723150364341760024327 0ustar00solution = [ 'workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/TaskQueues/Statistics'; } /** * Reads TaskQueuesStatisticsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskQueuesStatisticsInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TaskQueuesStatisticsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TaskQueuesStatisticsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TaskQueuesStatisticsPage Page of TaskQueuesStatisticsInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TaskQueuesStatisticsPage { $options = new Values($options); $params = Values::of([ 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'FriendlyName' => $options['friendlyName'], 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskChannel' => $options['taskChannel'], 'SplitByWaitTime' => $options['splitByWaitTime'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TaskQueuesStatisticsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskQueuesStatisticsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TaskQueuesStatisticsPage Page of TaskQueuesStatisticsInstance */ public function getPage(string $targetUrl): TaskQueuesStatisticsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskQueuesStatisticsPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php000064400000015367150364341760024672 0ustar00options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default is 15 minutes. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. * * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. * @return $this Fluent Builder */ public function setSplitByWaitTime(string $splitByWaitTime): self { $this->options['splitByWaitTime'] = $splitByWaitTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchTaskQueueStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php000064400000014441150364341760027032 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php000064400000010023150364341760024763 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php000064400000003410150364341760026134 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php000064400000005173150364341760025160 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php000064400000006133150364341760026711 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php000064400000003563150364341760024145 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php000064400000004605150364341760026306 0ustar00options['taskChannel'] = $taskChannel; } /** * The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchTaskQueueRealTimeStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php000064400000003643150364341760025567 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php000064400000006001150364341760024644 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php000064400000016502150364341760025045 0ustar00options['endDate'] = $endDate; $this->options['friendlyName'] = $friendlyName; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * The `friendly_name` of the TaskQueue statistics to read. * * @param string $friendlyName The `friendly_name` of the TaskQueue statistics to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only calculate statistics since this many minutes in the past. The default is 15 minutes. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. * * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. * @return $this Fluent Builder */ public function setSplitByWaitTime(string $splitByWaitTime): self { $this->options['splitByWaitTime'] = $splitByWaitTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadTaskQueuesStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php000064400000003314150364341760024100 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php000064400000005357150364341760026304 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php000064400000003374150364341760025531 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php000064400000003307150364341760023645 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php000064400000005331150364341760022771 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php000064400000011753150364341760022310 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php000064400000003215150364341760021412 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php000064400000014174150364341760021457 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'taskSid' => $taskSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Tasks/' . \rawurlencode($taskSid) .'/Reservations'; } /** * Reads ReservationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ReservationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ReservationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ReservationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ReservationPage Page of ReservationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ReservationPage { $options = new Values($options); $params = Values::of([ 'ReservationStatus' => $options['reservationStatus'], 'WorkerSid' => $options['workerSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ReservationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ReservationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ReservationPage Page of ReservationInstance */ public function getPage(string $targetUrl): ReservationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ReservationPage($this->version, $response, $this->solution); } /** * Constructs a ReservationContext * * @param string $sid The SID of the TaskReservation resource to fetch. */ public function getContext( string $sid ): ReservationContext { return new ReservationContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.ReservationList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php000064400000156742150364341760022207 0ustar00options['reservationStatus'] = $reservationStatus; $this->options['workerSid'] = $workerSid; } /** * Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. * * @param string $reservationStatus Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. * @return $this Fluent Builder */ public function setReservationStatus(string $reservationStatus): self { $this->options['reservationStatus'] = $reservationStatus; return $this; } /** * The SID of the reserved Worker resource to read. * * @param string $workerSid The SID of the reserved Worker resource to read. * @return $this Fluent Builder */ public function setWorkerSid(string $workerSid): self { $this->options['workerSid'] = $workerSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadReservationOptions ' . $options . ']'; } } class UpdateReservationOptions extends Options { /** * @param string $reservationStatus * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. * @param string $instruction The assignment instruction for reservation. * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. * @param string $dequeueFrom The Caller ID of the call to the worker when executing a Dequeue instruction. * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. * @param int $dequeueTimeout Timeout for call when executing a Dequeue instruction. * @param string $dequeueTo The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @param string $dequeueStatusCallbackUrl The Callback URL for completed call event when executing a Dequeue instruction. * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. * @param string $callRecord Whether to record both legs of a call when executing a Call instruction or which leg to record. * @param int $callTimeout Timeout for call when executing a Call instruction. * @param string $callTo The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @param string $from The Caller ID of the call to the worker when executing a Conference instruction. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. * @param int $timeout Timeout for call when executing a Conference instruction. * @param bool $record Whether to record the participant and their conferences, including the time between conferences. The default is `false`. * @param bool $muted Whether the agent is muted in the conference. The default is `false`. * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @param string $conferenceTrim How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @param string $sipAuthUsername The SIP username used for authentication. * @param string $sipAuthPassword The SIP password for authentication. * @param string[] $dequeueStatusCallbackEvent The Call progress events sent via webhooks as a result of a Dequeue instruction. * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. * @param string $supervisorMode * @param string $supervisor The Supervisor SID/URI when executing the Supervise instruction. * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $reservationStatus = Values::NONE, string $workerActivitySid = Values::NONE, string $instruction = Values::NONE, string $dequeuePostWorkActivitySid = Values::NONE, string $dequeueFrom = Values::NONE, string $dequeueRecord = Values::NONE, int $dequeueTimeout = Values::INT_NONE, string $dequeueTo = Values::NONE, string $dequeueStatusCallbackUrl = Values::NONE, string $callFrom = Values::NONE, string $callRecord = Values::NONE, int $callTimeout = Values::INT_NONE, string $callTo = Values::NONE, string $callUrl = Values::NONE, string $callStatusCallbackUrl = Values::NONE, bool $callAccept = Values::BOOL_NONE, string $redirectCallSid = Values::NONE, bool $redirectAccept = Values::BOOL_NONE, string $redirectUrl = Values::NONE, string $to = Values::NONE, string $from = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, int $timeout = Values::INT_NONE, bool $record = Values::BOOL_NONE, bool $muted = Values::BOOL_NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::BOOL_NONE, int $maxParticipants = Values::INT_NONE, string $conferenceStatusCallback = Values::NONE, string $conferenceStatusCallbackMethod = Values::NONE, array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, string $conferenceRecord = Values::NONE, string $conferenceTrim = Values::NONE, string $recordingChannels = Values::NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $conferenceRecordingStatusCallback = Values::NONE, string $conferenceRecordingStatusCallbackMethod = Values::NONE, string $region = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, array $dequeueStatusCallbackEvent = Values::ARRAY_NONE, string $postWorkActivitySid = Values::NONE, string $supervisorMode = Values::NONE, string $supervisor = Values::NONE, bool $endConferenceOnCustomerExit = Values::BOOL_NONE, bool $beepOnCustomerEntrance = Values::BOOL_NONE, string $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; } /** * @param string $reservationStatus * @return $this Fluent Builder */ public function setReservationStatus(string $reservationStatus): self { $this->options['reservationStatus'] = $reservationStatus; return $this; } /** * The new worker activity SID if rejecting a reservation. * * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. * @return $this Fluent Builder */ public function setWorkerActivitySid(string $workerActivitySid): self { $this->options['workerActivitySid'] = $workerActivitySid; return $this; } /** * The assignment instruction for reservation. * * @param string $instruction The assignment instruction for reservation. * @return $this Fluent Builder */ public function setInstruction(string $instruction): self { $this->options['instruction'] = $instruction; return $this; } /** * The SID of the Activity resource to start after executing a Dequeue instruction. * * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeuePostWorkActivitySid(string $dequeuePostWorkActivitySid): self { $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; return $this; } /** * The Caller ID of the call to the worker when executing a Dequeue instruction. * * @param string $dequeueFrom The Caller ID of the call to the worker when executing a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeueFrom(string $dequeueFrom): self { $this->options['dequeueFrom'] = $dequeueFrom; return $this; } /** * Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. * * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. * @return $this Fluent Builder */ public function setDequeueRecord(string $dequeueRecord): self { $this->options['dequeueRecord'] = $dequeueRecord; return $this; } /** * Timeout for call when executing a Dequeue instruction. * * @param int $dequeueTimeout Timeout for call when executing a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeueTimeout(int $dequeueTimeout): self { $this->options['dequeueTimeout'] = $dequeueTimeout; return $this; } /** * The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $dequeueTo The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @return $this Fluent Builder */ public function setDequeueTo(string $dequeueTo): self { $this->options['dequeueTo'] = $dequeueTo; return $this; } /** * The Callback URL for completed call event when executing a Dequeue instruction. * * @param string $dequeueStatusCallbackUrl The Callback URL for completed call event when executing a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeueStatusCallbackUrl(string $dequeueStatusCallbackUrl): self { $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; return $this; } /** * The Caller ID of the outbound call when executing a Call instruction. * * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. * @return $this Fluent Builder */ public function setCallFrom(string $callFrom): self { $this->options['callFrom'] = $callFrom; return $this; } /** * Whether to record both legs of a call when executing a Call instruction or which leg to record. * * @param string $callRecord Whether to record both legs of a call when executing a Call instruction or which leg to record. * @return $this Fluent Builder */ public function setCallRecord(string $callRecord): self { $this->options['callRecord'] = $callRecord; return $this; } /** * Timeout for call when executing a Call instruction. * * @param int $callTimeout Timeout for call when executing a Call instruction. * @return $this Fluent Builder */ public function setCallTimeout(int $callTimeout): self { $this->options['callTimeout'] = $callTimeout; return $this; } /** * The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $callTo The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @return $this Fluent Builder */ public function setCallTo(string $callTo): self { $this->options['callTo'] = $callTo; return $this; } /** * TwiML URI executed on answering the worker's leg as a result of the Call instruction. * * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. * @return $this Fluent Builder */ public function setCallUrl(string $callUrl): self { $this->options['callUrl'] = $callUrl; return $this; } /** * The URL to call for the completed call event when executing a Call instruction. * * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. * @return $this Fluent Builder */ public function setCallStatusCallbackUrl(string $callStatusCallbackUrl): self { $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; return $this; } /** * Whether to accept a reservation when executing a Call instruction. * * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. * @return $this Fluent Builder */ public function setCallAccept(bool $callAccept): self { $this->options['callAccept'] = $callAccept; return $this; } /** * The Call SID of the call parked in the queue when executing a Redirect instruction. * * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. * @return $this Fluent Builder */ public function setRedirectCallSid(string $redirectCallSid): self { $this->options['redirectCallSid'] = $redirectCallSid; return $this; } /** * Whether the reservation should be accepted when executing a Redirect instruction. * * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. * @return $this Fluent Builder */ public function setRedirectAccept(bool $redirectAccept): self { $this->options['redirectAccept'] = $redirectAccept; return $this; } /** * TwiML URI to redirect the call to when executing the Redirect instruction. * * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. * @return $this Fluent Builder */ public function setRedirectUrl(string $redirectUrl): self { $this->options['redirectUrl'] = $redirectUrl; return $this; } /** * The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * The Caller ID of the call to the worker when executing a Conference instruction. * * @param string $from The Caller ID of the call to the worker when executing a Conference instruction. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. * * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. * @return $this Fluent Builder */ public function setStatusCallbackEvent(array $statusCallbackEvent): self { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * Timeout for call when executing a Conference instruction. * * @param int $timeout Timeout for call when executing a Conference instruction. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the participant and their conferences, including the time between conferences. The default is `false`. * * @param bool $record Whether to record the participant and their conferences, including the time between conferences. The default is `false`. * @return $this Fluent Builder */ public function setRecord(bool $record): self { $this->options['record'] = $record; return $this; } /** * Whether the agent is muted in the conference. The default is `false`. * * @param bool $muted Whether the agent is muted in the conference. The default is `false`. * @return $this Fluent Builder */ public function setMuted(bool $muted): self { $this->options['muted'] = $muted; return $this; } /** * Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @return $this Fluent Builder */ public function setBeep(string $beep): self { $this->options['beep'] = $beep; return $this; } /** * Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @return $this Fluent Builder */ public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * Whether to end the conference when the agent leaves. * * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. * @return $this Fluent Builder */ public function setEndConferenceOnExit(bool $endConferenceOnExit): self { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @return $this Fluent Builder */ public function setWaitUrl(string $waitUrl): self { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @return $this Fluent Builder */ public function setWaitMethod(string $waitMethod): self { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. * * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. * @return $this Fluent Builder */ public function setEarlyMedia(bool $earlyMedia): self { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @return $this Fluent Builder */ public function setMaxParticipants(int $maxParticipants): self { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @return $this Fluent Builder */ public function setConferenceStatusCallback(string $conferenceStatusCallback): self { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. * * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @return $this Fluent Builder */ public function setConferenceRecord(string $conferenceRecord): self { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * * @param string $conferenceTrim How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @return $this Fluent Builder */ public function setConferenceTrim(string $conferenceTrim): self { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @return $this Fluent Builder */ public function setRecordingChannels(string $recordingChannels): self { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we should call using the `recording_status_callback_method` when the recording status changes. * * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @return $this Fluent Builder */ public function setRecordingStatusCallback(string $recordingStatusCallback): self { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @return $this Fluent Builder */ public function setRegion(string $region): self { $this->options['region'] = $region; return $this; } /** * The SIP username used for authentication. * * @param string $sipAuthUsername The SIP username used for authentication. * @return $this Fluent Builder */ public function setSipAuthUsername(string $sipAuthUsername): self { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The SIP password for authentication. * * @param string $sipAuthPassword The SIP password for authentication. * @return $this Fluent Builder */ public function setSipAuthPassword(string $sipAuthPassword): self { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The Call progress events sent via webhooks as a result of a Dequeue instruction. * * @param string[] $dequeueStatusCallbackEvent The Call progress events sent via webhooks as a result of a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeueStatusCallbackEvent(array $dequeueStatusCallbackEvent): self { $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; return $this; } /** * The new worker activity SID after executing a Conference instruction. * * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. * @return $this Fluent Builder */ public function setPostWorkActivitySid(string $postWorkActivitySid): self { $this->options['postWorkActivitySid'] = $postWorkActivitySid; return $this; } /** * @param string $supervisorMode * @return $this Fluent Builder */ public function setSupervisorMode(string $supervisorMode): self { $this->options['supervisorMode'] = $supervisorMode; return $this; } /** * The Supervisor SID/URI when executing the Supervise instruction. * * @param string $supervisor The Supervisor SID/URI when executing the Supervise instruction. * @return $this Fluent Builder */ public function setSupervisor(string $supervisor): self { $this->options['supervisor'] = $supervisor; return $this; } /** * Whether to end the conference when the customer leaves. * * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. * @return $this Fluent Builder */ public function setEndConferenceOnCustomerExit(bool $endConferenceOnCustomerExit): self { $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; return $this; } /** * Whether to play a notification beep when the customer joins. * * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. * @return $this Fluent Builder */ public function setBeepOnCustomerEntrance(bool $beepOnCustomerEntrance): self { $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; return $this; } /** * The 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 . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php000064400000017361150364341760022171 0ustar00solution = [ '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' => $options['statusCallbackEvent'], 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => $options['conferenceStatusCallbackEvent'], 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'Region' => $options['region'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'DequeueStatusCallbackEvent' => Serialize::map($options['dequeueStatusCallbackEvent'], function ($e) { return $e; }), 'PostWorkActivitySid' => $options['postWorkActivitySid'], 'SupervisorMode' => $options['supervisorMode'], 'Supervisor' => $options['supervisor'], 'EndConferenceOnCustomerExit' => Serialize::booleanToString($options['endConferenceOnCustomerExit']), 'BeepOnCustomerEntrance' => Serialize::booleanToString($options['beepOnCustomerEntrance']), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php000064400000021552150364341760017523 0ustar00solution = [ 'workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Workers'; } /** * Create the WorkerInstance * * @param string $friendlyName A descriptive string that you create to describe the new Worker. It can be up to 64 characters long. * @param array|Options $options Optional Arguments * @return WorkerInstance Created WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): WorkerInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'ActivitySid' => $options['activitySid'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WorkerInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Reads WorkerInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WorkerInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams WorkerInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WorkerInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WorkerPage Page of WorkerInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WorkerPage { $options = new Values($options); $params = Values::of([ 'ActivityName' => $options['activityName'], 'ActivitySid' => $options['activitySid'], 'Available' => $options['available'], 'FriendlyName' => $options['friendlyName'], 'TargetWorkersExpression' => $options['targetWorkersExpression'], 'TaskQueueName' => $options['taskQueueName'], 'TaskQueueSid' => $options['taskQueueSid'], 'Ordering' => $options['ordering'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WorkerPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WorkerInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WorkerPage Page of WorkerInstance */ public function getPage(string $targetUrl): WorkerPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WorkerPage($this->version, $response, $this->solution); } /** * Constructs a WorkerContext * * @param string $sid The SID of the Worker resource to delete. */ public function getContext( string $sid ): WorkerContext { return new WorkerContext( $this->version, $this->solution['workspaceSid'], $sid ); } /** * Access the statistics */ protected function getStatistics(): WorkersStatisticsList { if (!$this->_statistics) { $this->_statistics = new WorkersStatisticsList( $this->version, $this->solution['workspaceSid'] ); } return $this->_statistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.WorkerList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php000064400000007177150364341760023014 0ustar00options['capacity'] = $capacity; $this->options['available'] = $available; } /** * The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. * * @param int $capacity The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. * @return $this Fluent Builder */ public function setCapacity(int $capacity): self { $this->options['capacity'] = $capacity; return $this; } /** * Whether the WorkerChannel is available. Set to `false` to prevent the Worker from receiving any new Tasks of this TaskChannel type. * * @param bool $available Whether the WorkerChannel is available. Set to `false` to prevent the Worker from receiving any new Tasks of this TaskChannel type. * @return $this Fluent Builder */ public function setAvailable(bool $available): self { $this->options['available'] = $available; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.UpdateWorkerChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php000064400000003325150364341760025230 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php000064400000011456150364341760026124 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php000064400000011777150364341760022665 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php000064400000003223150364341760021760 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php000064400000003231150364341760023165 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php000064400000006647150364341760023006 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php000064400000004730150364341760025365 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php000064400000013341150364341760022262 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Workers/' . \rawurlencode($workerSid) .'/Channels'; } /** * Reads WorkerChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WorkerChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WorkerChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WorkerChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WorkerChannelPage Page of WorkerChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WorkerChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WorkerChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WorkerChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WorkerChannelPage Page of WorkerChannelInstance */ public function getPage(string $targetUrl): WorkerChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WorkerChannelPage($this->version, $response, $this->solution); } /** * Constructs a WorkerChannelContext * * @param string $sid The SID of the WorkerChannel to fetch. */ public function getContext( string $sid ): WorkerChannelContext { return new WorkerChannelContext( $this->version, $this->solution['workspaceSid'], $this->solution['workerSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.WorkerChannelList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php000064400000003311150364341760024607 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php000064400000003522150364341760023044 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php000064400000012476150364341760023123 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php000064400000007564150364341760023707 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php000064400000014122150364341760022017 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Workers/' . \rawurlencode($workerSid) .'/Reservations'; } /** * Reads ReservationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ReservationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ReservationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ReservationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ReservationPage Page of ReservationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ReservationPage { $options = new Values($options); $params = Values::of([ 'ReservationStatus' => $options['reservationStatus'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ReservationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ReservationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ReservationPage Page of ReservationInstance */ public function getPage(string $targetUrl): ReservationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ReservationPage($this->version, $response, $this->solution); } /** * Constructs a ReservationContext * * @param string $sid The SID of the WorkerReservation resource to fetch. */ public function getContext( string $sid ): ReservationContext { return new ReservationContext( $this->version, $this->solution['workspaceSid'], $this->solution['workerSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.ReservationList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php000064400000005564150364341760023750 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php000064400000003273150364341760025271 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php000064400000013053150364341760023564 0ustar00options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkerStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php000064400000003257150364341760024657 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php000064400000005606150364341760023562 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php000064400000005366150364341760026007 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php000064400000153711150364341760022547 0ustar00options['reservationStatus'] = $reservationStatus; } /** * Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. * * @param string $reservationStatus Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. * @return $this Fluent Builder */ public function setReservationStatus(string $reservationStatus): self { $this->options['reservationStatus'] = $reservationStatus; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadReservationOptions ' . $options . ']'; } } class UpdateReservationOptions extends Options { /** * @param string $reservationStatus * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. * @param string $instruction The assignment instruction for the reservation. * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. * @param string $dequeueFrom The caller ID of the call to the worker when executing a Dequeue instruction. * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. * @param int $dequeueTimeout The timeout for call when executing a Dequeue instruction. * @param string $dequeueTo The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @param string $dequeueStatusCallbackUrl The callback URL for completed call event when executing a Dequeue instruction. * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. * @param string $callRecord Whether to record both legs of a call when executing a Call instruction. * @param int $callTimeout The timeout for a call when executing a Call instruction. * @param string $callTo The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @param string $from The caller ID of the call to the worker when executing a Conference instruction. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. * @param int $timeout The timeout for a call when executing a Conference instruction. * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * @param bool $muted Whether the agent is muted in the conference. Defaults to `false`. * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. * @param int $maxParticipants The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @param string $conferenceTrim Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @param string $sipAuthUsername The SIP username used for authentication. * @param string $sipAuthPassword The SIP password for authentication. * @param string[] $dequeueStatusCallbackEvent The call progress events sent via webhooks as a result of a Dequeue instruction. * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $reservationStatus = Values::NONE, string $workerActivitySid = Values::NONE, string $instruction = Values::NONE, string $dequeuePostWorkActivitySid = Values::NONE, string $dequeueFrom = Values::NONE, string $dequeueRecord = Values::NONE, int $dequeueTimeout = Values::INT_NONE, string $dequeueTo = Values::NONE, string $dequeueStatusCallbackUrl = Values::NONE, string $callFrom = Values::NONE, string $callRecord = Values::NONE, int $callTimeout = Values::INT_NONE, string $callTo = Values::NONE, string $callUrl = Values::NONE, string $callStatusCallbackUrl = Values::NONE, bool $callAccept = Values::BOOL_NONE, string $redirectCallSid = Values::NONE, bool $redirectAccept = Values::BOOL_NONE, string $redirectUrl = Values::NONE, string $to = Values::NONE, string $from = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, int $timeout = Values::INT_NONE, bool $record = Values::BOOL_NONE, bool $muted = Values::BOOL_NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::BOOL_NONE, int $maxParticipants = Values::INT_NONE, string $conferenceStatusCallback = Values::NONE, string $conferenceStatusCallbackMethod = Values::NONE, array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, string $conferenceRecord = Values::NONE, string $conferenceTrim = Values::NONE, string $recordingChannels = Values::NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $conferenceRecordingStatusCallback = Values::NONE, string $conferenceRecordingStatusCallbackMethod = Values::NONE, string $region = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, array $dequeueStatusCallbackEvent = Values::ARRAY_NONE, string $postWorkActivitySid = Values::NONE, bool $endConferenceOnCustomerExit = Values::BOOL_NONE, bool $beepOnCustomerEntrance = Values::BOOL_NONE, string $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; } /** * @param string $reservationStatus * @return $this Fluent Builder */ public function setReservationStatus(string $reservationStatus): self { $this->options['reservationStatus'] = $reservationStatus; return $this; } /** * The new worker activity SID if rejecting a reservation. * * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. * @return $this Fluent Builder */ public function setWorkerActivitySid(string $workerActivitySid): self { $this->options['workerActivitySid'] = $workerActivitySid; return $this; } /** * The assignment instruction for the reservation. * * @param string $instruction The assignment instruction for the reservation. * @return $this Fluent Builder */ public function setInstruction(string $instruction): self { $this->options['instruction'] = $instruction; return $this; } /** * The SID of the Activity resource to start after executing a Dequeue instruction. * * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeuePostWorkActivitySid(string $dequeuePostWorkActivitySid): self { $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; return $this; } /** * The caller ID of the call to the worker when executing a Dequeue instruction. * * @param string $dequeueFrom The caller ID of the call to the worker when executing a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeueFrom(string $dequeueFrom): self { $this->options['dequeueFrom'] = $dequeueFrom; return $this; } /** * Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. * * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. * @return $this Fluent Builder */ public function setDequeueRecord(string $dequeueRecord): self { $this->options['dequeueRecord'] = $dequeueRecord; return $this; } /** * The timeout for call when executing a Dequeue instruction. * * @param int $dequeueTimeout The timeout for call when executing a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeueTimeout(int $dequeueTimeout): self { $this->options['dequeueTimeout'] = $dequeueTimeout; return $this; } /** * The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $dequeueTo The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @return $this Fluent Builder */ public function setDequeueTo(string $dequeueTo): self { $this->options['dequeueTo'] = $dequeueTo; return $this; } /** * The callback URL for completed call event when executing a Dequeue instruction. * * @param string $dequeueStatusCallbackUrl The callback URL for completed call event when executing a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeueStatusCallbackUrl(string $dequeueStatusCallbackUrl): self { $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; return $this; } /** * The Caller ID of the outbound call when executing a Call instruction. * * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. * @return $this Fluent Builder */ public function setCallFrom(string $callFrom): self { $this->options['callFrom'] = $callFrom; return $this; } /** * Whether to record both legs of a call when executing a Call instruction. * * @param string $callRecord Whether to record both legs of a call when executing a Call instruction. * @return $this Fluent Builder */ public function setCallRecord(string $callRecord): self { $this->options['callRecord'] = $callRecord; return $this; } /** * The timeout for a call when executing a Call instruction. * * @param int $callTimeout The timeout for a call when executing a Call instruction. * @return $this Fluent Builder */ public function setCallTimeout(int $callTimeout): self { $this->options['callTimeout'] = $callTimeout; return $this; } /** * The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $callTo The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @return $this Fluent Builder */ public function setCallTo(string $callTo): self { $this->options['callTo'] = $callTo; return $this; } /** * TwiML URI executed on answering the worker's leg as a result of the Call instruction. * * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. * @return $this Fluent Builder */ public function setCallUrl(string $callUrl): self { $this->options['callUrl'] = $callUrl; return $this; } /** * The URL to call for the completed call event when executing a Call instruction. * * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. * @return $this Fluent Builder */ public function setCallStatusCallbackUrl(string $callStatusCallbackUrl): self { $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; return $this; } /** * Whether to accept a reservation when executing a Call instruction. * * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. * @return $this Fluent Builder */ public function setCallAccept(bool $callAccept): self { $this->options['callAccept'] = $callAccept; return $this; } /** * The Call SID of the call parked in the queue when executing a Redirect instruction. * * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. * @return $this Fluent Builder */ public function setRedirectCallSid(string $redirectCallSid): self { $this->options['redirectCallSid'] = $redirectCallSid; return $this; } /** * Whether the reservation should be accepted when executing a Redirect instruction. * * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. * @return $this Fluent Builder */ public function setRedirectAccept(bool $redirectAccept): self { $this->options['redirectAccept'] = $redirectAccept; return $this; } /** * TwiML URI to redirect the call to when executing the Redirect instruction. * * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. * @return $this Fluent Builder */ public function setRedirectUrl(string $redirectUrl): self { $this->options['redirectUrl'] = $redirectUrl; return $this; } /** * The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * The caller ID of the call to the worker when executing a Conference instruction. * * @param string $from The caller ID of the call to the worker when executing a Conference instruction. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. * * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. * @return $this Fluent Builder */ public function setStatusCallbackEvent(array $statusCallbackEvent): self { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The timeout for a call when executing a Conference instruction. * * @param int $timeout The timeout for a call when executing a Conference instruction. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setRecord(bool $record): self { $this->options['record'] = $record; return $this; } /** * Whether the agent is muted in the conference. Defaults to `false`. * * @param bool $muted Whether the agent is muted in the conference. Defaults to `false`. * @return $this Fluent Builder */ public function setMuted(bool $muted): self { $this->options['muted'] = $muted; return $this; } /** * Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @return $this Fluent Builder */ public function setBeep(string $beep): self { $this->options['beep'] = $beep; return $this; } /** * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @return $this Fluent Builder */ public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * Whether to end the conference when the agent leaves. * * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. * @return $this Fluent Builder */ public function setEndConferenceOnExit(bool $endConferenceOnExit): self { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @return $this Fluent Builder */ public function setWaitUrl(string $waitUrl): self { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @return $this Fluent Builder */ public function setWaitMethod(string $waitMethod): self { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. * * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. * @return $this Fluent Builder */ public function setEarlyMedia(bool $earlyMedia): self { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * * @param int $maxParticipants The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @return $this Fluent Builder */ public function setMaxParticipants(int $maxParticipants): self { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @return $this Fluent Builder */ public function setConferenceStatusCallback(string $conferenceStatusCallback): self { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. * * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @return $this Fluent Builder */ public function setConferenceRecord(string $conferenceRecord): self { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * * @param string $conferenceTrim Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @return $this Fluent Builder */ public function setConferenceTrim(string $conferenceTrim): self { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @return $this Fluent Builder */ public function setRecordingChannels(string $recordingChannels): self { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we should call using the `recording_status_callback_method` when the recording status changes. * * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @return $this Fluent Builder */ public function setRecordingStatusCallback(string $recordingStatusCallback): self { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @return $this Fluent Builder */ public function setRegion(string $region): self { $this->options['region'] = $region; return $this; } /** * The SIP username used for authentication. * * @param string $sipAuthUsername The SIP username used for authentication. * @return $this Fluent Builder */ public function setSipAuthUsername(string $sipAuthUsername): self { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The SIP password for authentication. * * @param string $sipAuthPassword The SIP password for authentication. * @return $this Fluent Builder */ public function setSipAuthPassword(string $sipAuthPassword): self { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The call progress events sent via webhooks as a result of a Dequeue instruction. * * @param string[] $dequeueStatusCallbackEvent The call progress events sent via webhooks as a result of a Dequeue instruction. * @return $this Fluent Builder */ public function setDequeueStatusCallbackEvent(array $dequeueStatusCallbackEvent): self { $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; return $this; } /** * The new worker activity SID after executing a Conference instruction. * * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. * @return $this Fluent Builder */ public function setPostWorkActivitySid(string $postWorkActivitySid): self { $this->options['postWorkActivitySid'] = $postWorkActivitySid; return $this; } /** * Whether to end the conference when the customer leaves. * * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. * @return $this Fluent Builder */ public function setEndConferenceOnCustomerExit(bool $endConferenceOnCustomerExit): self { $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; return $this; } /** * Whether to play a notification beep when the customer joins. * * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. * @return $this Fluent Builder */ public function setBeepOnCustomerEntrance(bool $beepOnCustomerEntrance): self { $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; return $this; } /** * The 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 . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php000064400000003261150364341760023005 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php000064400000007500150364341760025503 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php000064400000017606150364341760023757 0ustar00options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskQueueName'] = $taskQueueName; $this->options['friendlyName'] = $friendlyName; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * The SID of the TaskQueue for which to fetch Worker statistics. * * @param string $taskQueueSid The SID of the TaskQueue for which to fetch Worker statistics. * @return $this Fluent Builder */ public function setTaskQueueSid(string $taskQueueSid): self { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The `friendly_name` of the TaskQueue for which to fetch Worker statistics. * * @param string $taskQueueName The `friendly_name` of the TaskQueue for which to fetch Worker statistics. * @return $this Fluent Builder */ public function setTaskQueueName(string $taskQueueName): self { $this->options['taskQueueName'] = $taskQueueName; return $this; } /** * Only include Workers with `friendly_name` values that match this parameter. * * @param string $friendlyName Only include Workers with `friendly_name` values that match this parameter. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkersStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php000064400000003237150364341760022226 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php000064400000013175150364341760026013 0ustar00options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkersCumulativeStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php000064400000004636150364341760025401 0ustar00options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkersRealTimeStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php000064400000017173150364341760022541 0ustar00solution = [ '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' => $options['statusCallbackEvent'], 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => $options['conferenceStatusCallbackEvent'], 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'Region' => $options['region'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'DequeueStatusCallbackEvent' => Serialize::map($options['dequeueStatusCallbackEvent'], function ($e) { return $e; }), 'PostWorkActivitySid' => $options['postWorkActivitySid'], 'EndConferenceOnCustomerExit' => Serialize::booleanToString($options['endConferenceOnCustomerExit']), 'BeepOnCustomerEntrance' => Serialize::booleanToString($options['beepOnCustomerEntrance']), ]); $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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php000064400000003175150364341760023233 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php000064400000007300150364341760024056 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php000064400000003256150364341760024323 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php000064400000021556150364341760020165 0ustar00solution = [ 'workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/TaskQueues'; } /** * Create the TaskQueueInstance * * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. * @param array|Options $options Optional Arguments * @return TaskQueueInstance Created TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): TaskQueueInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'TargetWorkers' => $options['targetWorkers'], 'MaxReservedWorkers' => $options['maxReservedWorkers'], 'TaskOrder' => $options['taskOrder'], 'ReservationActivitySid' => $options['reservationActivitySid'], 'AssignmentActivitySid' => $options['assignmentActivitySid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TaskQueueInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Reads TaskQueueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskQueueInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TaskQueueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TaskQueueInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TaskQueuePage Page of TaskQueueInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TaskQueuePage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'EvaluateWorkerAttributes' => $options['evaluateWorkerAttributes'], 'WorkerSid' => $options['workerSid'], 'Ordering' => $options['ordering'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TaskQueuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskQueueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TaskQueuePage Page of TaskQueueInstance */ public function getPage(string $targetUrl): TaskQueuePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskQueuePage($this->version, $response, $this->solution); } /** * Constructs a TaskQueueContext * * @param string $sid The SID of the TaskQueue resource to delete. */ public function getContext( string $sid ): TaskQueueContext { return new TaskQueueContext( $this->version, $this->solution['workspaceSid'], $sid ); } /** * Access the statistics */ protected function getStatistics(): TaskQueuesStatisticsList { if (!$this->_statistics) { $this->_statistics = new TaskQueuesStatisticsList( $this->version, $this->solution['workspaceSid'] ); } return $this->_statistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.TaskQueueList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php000064400000026623150364341760020057 0ustar00options['endDate'] = $endDate; $this->options['eventType'] = $eventType; $this->options['minutes'] = $minutes; $this->options['reservationSid'] = $reservationSid; $this->options['startDate'] = $startDate; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskSid'] = $taskSid; $this->options['workerSid'] = $workerSid; $this->options['workflowSid'] = $workflowSid; $this->options['taskChannel'] = $taskChannel; $this->options['sid'] = $sid; } /** * Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * The type of Events to read. Returns only Events of the type specified. * * @param string $eventType The type of Events to read. Returns only Events of the type specified. * @return $this Fluent Builder */ public function setEventType(string $eventType): self { $this->options['eventType'] = $eventType; return $this; } /** * The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. * * @param int $minutes The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. * * @param string $reservationSid The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. * @return $this Fluent Builder */ public function setReservationSid(string $reservationSid): self { $this->options['reservationSid'] = $reservationSid; return $this; } /** * Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. * * @param \DateTime $startDate Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. * * @param string $taskQueueSid The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. * @return $this Fluent Builder */ public function setTaskQueueSid(string $taskQueueSid): self { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. * * @param string $taskSid The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. * @return $this Fluent Builder */ public function setTaskSid(string $taskSid): self { $this->options['taskSid'] = $taskSid; return $this; } /** * The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. * * @param string $workerSid The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. * @return $this Fluent Builder */ public function setWorkerSid(string $workerSid): self { $this->options['workerSid'] = $workerSid; return $this; } /** * The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. * * @param string $workflowSid The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. * @return $this Fluent Builder */ public function setWorkflowSid(string $workflowSid): self { $this->options['workflowSid'] = $workflowSid; return $this; } /** * The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. * * @param string $taskChannel The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The SID of the Event resource to read. * * @param string $sid The SID of the Event resource to read. * @return $this Fluent Builder */ public function setSid(string $sid): self { $this->options['sid'] = $sid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.ReadEventOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php000064400000016254150364341760020067 0ustar00solution = [ 'workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Workflows'; } /** * Create the WorkflowInstance * * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. * @param array|Options $options Optional Arguments * @return WorkflowInstance Created WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $configuration, array $options = []): WorkflowInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Configuration' => $configuration, 'AssignmentCallbackUrl' => $options['assignmentCallbackUrl'], 'FallbackAssignmentCallbackUrl' => $options['fallbackAssignmentCallbackUrl'], 'TaskReservationTimeout' => $options['taskReservationTimeout'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WorkflowInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Reads WorkflowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WorkflowInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams WorkflowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WorkflowInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WorkflowPage Page of WorkflowInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WorkflowPage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WorkflowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WorkflowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WorkflowPage Page of WorkflowInstance */ public function getPage(string $targetUrl): WorkflowPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WorkflowPage($this->version, $response, $this->solution); } /** * Constructs a WorkflowContext * * @param string $sid The SID of the Workflow resource to delete. */ public function getContext( string $sid ): WorkflowContext { return new WorkflowContext( $this->version, $this->solution['workspaceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.WorkflowList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelOptions.php000064400000012227150364341760021164 0ustar00options['channelOptimizedRouting'] = $channelOptimizedRouting; } /** * Whether the Task Channel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. * * @param bool $channelOptimizedRouting Whether the Task Channel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. * @return $this Fluent Builder */ public function setChannelOptimizedRouting(bool $channelOptimizedRouting): self { $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.CreateTaskChannelOptions ' . $options . ']'; } } class UpdateTaskChannelOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. * @param bool $channelOptimizedRouting Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. */ public function __construct( string $friendlyName = Values::NONE, bool $channelOptimizedRouting = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; } /** * A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. * * @param bool $channelOptimizedRouting Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. * @return $this Fluent Builder */ public function setChannelOptimizedRouting(bool $channelOptimizedRouting): self { $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.UpdateTaskChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php000064400000007277150364341760023124 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php000064400000003242150364341760023702 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php000064400000011422150364341760020672 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'available' => Values::array_get($payload, 'available'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ActivityContext Context for this ActivityInstance */ protected function proxy(): ActivityContext { if (!$this->context) { $this->context = new ActivityContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ActivityInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ActivityInstance * * @return ActivityInstance Fetched ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ActivityInstance { return $this->proxy()->fetch(); } /** * Update the ActivityInstance * * @param array|Options $options Optional Arguments * @return ActivityInstance Updated ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ActivityInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.ActivityInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php000064400000003700150364341760025367 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php000064400000003303150364341760023704 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php000064400000011050150364341760026215 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php000064400000020004150364341760024460 0ustar00options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. * * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. * @return $this Fluent Builder */ public function setSplitByWaitTime(string $splitByWaitTime): self { $this->options['splitByWaitTime'] = $splitByWaitTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkflowStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php000064400000003377150364341760025756 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php000064400000003363150364341760025335 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php000064400000020574150364341760026533 0ustar00options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. * * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. * @return $this Fluent Builder */ public function setSplitByWaitTime(string $splitByWaitTime): self { $this->options['splitByWaitTime'] = $splitByWaitTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkflowCumulativeStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php000064400000014427150364341760026644 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php000064400000005410150364341760026100 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php000064400000006032150364341760024456 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php000064400000004646150364341760026121 0ustar00options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkflowRealTimeStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php000064400000006164150364341760026523 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php000064400000003620150364341760023745 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php000064400000003714150364341760026010 0ustar00solution = [ '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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php000064400000010047150364341760024577 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php000064400000003111150364341760017453 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php000064400000014764150364341760021021 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'assignmentActivitySid' => Values::array_get($payload, 'assignment_activity_sid'), 'assignmentActivityName' => Values::array_get($payload, 'assignment_activity_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'maxReservedWorkers' => Values::array_get($payload, 'max_reserved_workers'), 'reservationActivitySid' => Values::array_get($payload, 'reservation_activity_sid'), 'reservationActivityName' => Values::array_get($payload, 'reservation_activity_name'), 'sid' => Values::array_get($payload, 'sid'), 'targetWorkers' => Values::array_get($payload, 'target_workers'), 'taskOrder' => Values::array_get($payload, 'task_order'), 'url' => Values::array_get($payload, 'url'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TaskQueueContext Context for this TaskQueueInstance */ protected function proxy(): TaskQueueContext { if (!$this->context) { $this->context = new TaskQueueContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TaskQueueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TaskQueueInstance * * @return TaskQueueInstance Fetched TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskQueueInstance { return $this->proxy()->fetch(); } /** * Update the TaskQueueInstance * * @param array|Options $options Optional Arguments * @return TaskQueueInstance Updated TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TaskQueueInstance { return $this->proxy()->update($options); } /** * Access the cumulativeStatistics */ protected function getCumulativeStatistics(): TaskQueueCumulativeStatisticsList { return $this->proxy()->cumulativeStatistics; } /** * Access the statistics */ protected function getStatistics(): TaskQueueStatisticsList { return $this->proxy()->statistics; } /** * Access the realTimeStatistics */ protected function getRealTimeStatistics(): TaskQueueRealTimeStatisticsList { return $this->proxy()->realTimeStatistics; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php000064400000013144150364341760017663 0ustar00solution = [ 'workspaceSid' => $workspaceSid, 'sid' => $sid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Tasks/' . \rawurlencode($sid) .''; } /** * Delete the TaskInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TaskInstance { $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'], 'VirtualStartTime' => Serialize::iso8601DateTime($options['virtualStartTime']), ]); $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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php000064400000011661150364341760020164 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php000064400000017731150364341760023007 0ustar00options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * @return $this Fluent Builder */ public function setMinutes(int $minutes): self { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * @return $this Fluent Builder */ public function setTaskChannel(string $taskChannel): self { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. * * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. * @return $this Fluent Builder */ public function setSplitByWaitTime(string $splitByWaitTime): self { $this->options['splitByWaitTime'] = $splitByWaitTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Taskrouter.V1.FetchWorkspaceStatisticsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php000064400000015662150364341760020053 0ustar00solution = [ 'workspaceSid' => $workspaceSid, ]; $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) .'/Activities'; } /** * Create the ActivityInstance * * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. * @param array|Options $options Optional Arguments * @return ActivityInstance Created ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): ActivityInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Available' => Serialize::booleanToString($options['available']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ActivityInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Reads ActivityInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ActivityInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ActivityInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ActivityInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ActivityPage Page of ActivityInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ActivityPage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Available' => $options['available'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ActivityPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ActivityInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ActivityPage Page of ActivityInstance */ public function getPage(string $targetUrl): ActivityPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ActivityPage($this->version, $response, $this->solution); } /** * Constructs a ActivityContext * * @param string $sid The SID of the Activity resource to delete. */ public function getContext( string $sid ): ActivityContext { return new ActivityContext( $this->version, $this->solution['workspaceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter.V1.ActivityList]'; } } sdk/src/Twilio/Rest/Client.php000064400000060661150364341760012251 0ustar00_accounts) { $this->_accounts = new Accounts($this); } return $this->_accounts; } /** * Access the Api Twilio Domain * * @return Api Api Twilio Domain */ protected function getApi(): Api { if (!$this->_api) { $this->_api = new Api($this); } return $this->_api; } /** * Access the 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 Bulkexports Twilio Domain * * @return Bulkexports Bulkexports Twilio Domain */ protected function getBulkexports(): Bulkexports { if (!$this->_bulkexports) { $this->_bulkexports = new Bulkexports($this); } return $this->_bulkexports; } /** * Access the Chat Twilio Domain * * @return Chat Chat Twilio Domain */ protected function getChat(): Chat { if (!$this->_chat) { $this->_chat = new Chat($this); } return $this->_chat; } /** * Access the Content Twilio Domain * * @return Content Content Twilio Domain */ protected function getContent(): Content { if (!$this->_content) { $this->_content = new Content($this); } return $this->_content; } /** * Access the Conversations Twilio Domain * * @return Conversations Conversations Twilio Domain */ protected function getConversations(): Conversations { if (!$this->_conversations) { $this->_conversations = new Conversations($this); } return $this->_conversations; } /** * Access the Events Twilio Domain * * @return Events Events Twilio Domain */ protected function getEvents(): Events { if (!$this->_events) { $this->_events = new Events($this); } return $this->_events; } /** * Access the FlexApi Twilio Domain * * @return FlexApi FlexApi Twilio Domain */ protected function getFlexApi(): FlexApi { if (!$this->_flexApi) { $this->_flexApi = new FlexApi($this); } return $this->_flexApi; } /** * Access the FrontlineApi Twilio Domain * * @return FrontlineApi FrontlineApi Twilio Domain */ protected function getFrontlineApi(): FrontlineApi { if (!$this->_frontlineApi) { $this->_frontlineApi = new FrontlineApi($this); } return $this->_frontlineApi; } /** * Access the Insights Twilio Domain * * @return Insights Insights Twilio Domain */ protected function getInsights(): Insights { if (!$this->_insights) { $this->_insights = new Insights($this); } return $this->_insights; } /** * Access the Intelligence Twilio Domain * * @return Intelligence Intelligence Twilio Domain */ protected function getIntelligence(): Intelligence { if (!$this->_intelligence) { $this->_intelligence = new Intelligence($this); } return $this->_intelligence; } /** * Access the IpMessaging Twilio Domain * * @return IpMessaging IpMessaging Twilio Domain */ protected function getIpMessaging(): IpMessaging { if (!$this->_ipMessaging) { $this->_ipMessaging = new IpMessaging($this); } return $this->_ipMessaging; } /** * Access the Lookups Twilio Domain * * @return Lookups Lookups Twilio Domain */ protected function getLookups(): Lookups { if (!$this->_lookups) { $this->_lookups = new Lookups($this); } return $this->_lookups; } /** * Access the 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 Microvisor Twilio Domain * * @return Microvisor Microvisor Twilio Domain */ protected function getMicrovisor(): Microvisor { if (!$this->_microvisor) { $this->_microvisor = new Microvisor($this); } return $this->_microvisor; } /** * Access the Monitor Twilio Domain * * @return Monitor Monitor Twilio Domain */ protected function getMonitor(): Monitor { if (!$this->_monitor) { $this->_monitor = new Monitor($this); } return $this->_monitor; } /** * Access the Notify Twilio Domain * * @return Notify Notify Twilio Domain */ protected function getNotify(): Notify { if (!$this->_notify) { $this->_notify = new Notify($this); } return $this->_notify; } /** * Access the Numbers Twilio Domain * * @return Numbers Numbers Twilio Domain */ protected function getNumbers(): Numbers { if (!$this->_numbers) { $this->_numbers = new Numbers($this); } return $this->_numbers; } /** * Access the Oauth Twilio Domain * * @return Oauth Oauth Twilio Domain */ protected function getOauth(): Oauth { if (!$this->_oauth) { $this->_oauth = new Oauth($this); } return $this->_oauth; } /** * Access the Preview Twilio Domain * * @return Preview Preview Twilio Domain */ protected function getPreview(): Preview { if (!$this->_preview) { $this->_preview = new Preview($this); } return $this->_preview; } /** * Access the Pricing Twilio Domain * * @return Pricing Pricing Twilio Domain */ protected function getPricing(): Pricing { if (!$this->_pricing) { $this->_pricing = new Pricing($this); } return $this->_pricing; } /** * Access the Proxy Twilio Domain * * @return Proxy Proxy Twilio Domain */ protected function getProxy(): Proxy { if (!$this->_proxy) { $this->_proxy = new Proxy($this); } return $this->_proxy; } /** * Access the Routes Twilio Domain * * @return Routes Routes Twilio Domain */ protected function getRoutes(): Routes { if (!$this->_routes) { $this->_routes = new Routes($this); } return $this->_routes; } /** * Access the Serverless Twilio Domain * * @return Serverless Serverless Twilio Domain */ protected function getServerless(): Serverless { if (!$this->_serverless) { $this->_serverless = new Serverless($this); } return $this->_serverless; } /** * Access the Studio Twilio Domain * * @return Studio Studio Twilio Domain */ protected function getStudio(): Studio { if (!$this->_studio) { $this->_studio = new Studio($this); } return $this->_studio; } /** * Access the Supersim Twilio Domain * * @return Supersim Supersim Twilio Domain */ protected function getSupersim(): Supersim { if (!$this->_supersim) { $this->_supersim = new Supersim($this); } return $this->_supersim; } /** * Access the Sync Twilio Domain * * @return Sync Sync Twilio Domain */ protected function getSync(): Sync { if (!$this->_sync) { $this->_sync = new Sync($this); } return $this->_sync; } /** * Access the Taskrouter Twilio Domain * * @return Taskrouter Taskrouter Twilio Domain */ protected function getTaskrouter(): Taskrouter { if (!$this->_taskrouter) { $this->_taskrouter = new Taskrouter($this); } return $this->_taskrouter; } /** * Access the Trunking Twilio Domain * * @return Trunking Trunking Twilio Domain */ protected function getTrunking(): Trunking { if (!$this->_trunking) { $this->_trunking = new Trunking($this); } return $this->_trunking; } /** * Access the Trusthub Twilio Domain * * @return Trusthub Trusthub Twilio Domain */ protected function getTrusthub(): Trusthub { if (!$this->_trusthub) { $this->_trusthub = new Trusthub($this); } return $this->_trusthub; } /** * Access the Verify Twilio Domain * * @return Verify Verify Twilio Domain */ protected function getVerify(): Verify { if (!$this->_verify) { $this->_verify = new Verify($this); } return $this->_verify; } /** * Access the Video Twilio Domain * * @return Video Video Twilio Domain */ protected function getVideo(): Video { if (!$this->_video) { $this->_video = new Video($this); } return $this->_video; } /** * Access the Voice Twilio Domain * * @return Voice Voice Twilio Domain */ protected function getVoice(): Voice { if (!$this->_voice) { $this->_voice = new Voice($this); } return $this->_voice; } /** * Access the Wireless Twilio Domain * * @return Wireless Wireless Twilio Domain */ protected function getWireless(): Wireless { if (!$this->_wireless) { $this->_wireless = new Wireless($this); } return $this->_wireless; } protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { return $this->api->v2010->account->addresses; } /** * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to fetch. */ protected function contextAddresses(string $sid): \Twilio\Rest\Api\V2010\Account\AddressContext { return $this->api->v2010->account->addresses($sid); } protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { return $this->api->v2010->account->applications; } /** * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to fetch. */ protected function contextApplications(string $sid): \Twilio\Rest\Api\V2010\Account\ApplicationContext { return $this->api->v2010->account->applications($sid); } protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { return $this->api->v2010->account->authorizedConnectApps; } /** * @param string $connectAppSid The SID of the Connect App to fetch. */ protected function contextAuthorizedConnectApps(string $connectAppSid): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext { return $this->api->v2010->account->authorizedConnectApps($connectAppSid); } protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { return $this->api->v2010->account->availablePhoneNumbers; } /** * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. */ protected function contextAvailablePhoneNumbers(string $countryCode): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext { return $this->api->v2010->account->availablePhoneNumbers($countryCode); } protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { return $this->api->v2010->account->balance; } protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { return $this->api->v2010->account->calls; } /** * @param string $sid The SID of the Call resource to fetch. */ protected function contextCalls(string $sid): \Twilio\Rest\Api\V2010\Account\CallContext { return $this->api->v2010->account->calls($sid); } protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { return $this->api->v2010->account->conferences; } /** * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch */ protected function contextConferences(string $sid): \Twilio\Rest\Api\V2010\Account\ConferenceContext { return $this->api->v2010->account->conferences($sid); } protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { return $this->api->v2010->account->connectApps; } /** * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. */ protected function contextConnectApps(string $sid): \Twilio\Rest\Api\V2010\Account\ConnectAppContext { return $this->api->v2010->account->connectApps($sid); } protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { return $this->api->v2010->account->incomingPhoneNumbers; } /** * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch. */ protected function contextIncomingPhoneNumbers(string $sid): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext { return $this->api->v2010->account->incomingPhoneNumbers($sid); } protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { return $this->api->v2010->account->keys; } /** * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to fetch. */ protected function contextKeys(string $sid): \Twilio\Rest\Api\V2010\Account\KeyContext { return $this->api->v2010->account->keys($sid); } protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { return $this->api->v2010->account->messages; } /** * @param string $sid The SID of the Message resource to be fetched */ protected function contextMessages(string $sid): \Twilio\Rest\Api\V2010\Account\MessageContext { return $this->api->v2010->account->messages($sid); } protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { return $this->api->v2010->account->newKeys; } protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { return $this->api->v2010->account->newSigningKeys; } protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { return $this->api->v2010->account->notifications; } /** * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. */ protected function contextNotifications(string $sid): \Twilio\Rest\Api\V2010\Account\NotificationContext { return $this->api->v2010->account->notifications($sid); } protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { return $this->api->v2010->account->outgoingCallerIds; } /** * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to fetch. */ protected function contextOutgoingCallerIds(string $sid): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext { return $this->api->v2010->account->outgoingCallerIds($sid); } protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { return $this->api->v2010->account->queues; } /** * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to fetch */ protected function contextQueues(string $sid): \Twilio\Rest\Api\V2010\Account\QueueContext { return $this->api->v2010->account->queues($sid); } protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { return $this->api->v2010->account->recordings; } /** * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to fetch. */ protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext { return $this->api->v2010->account->recordings($sid); } protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { return $this->api->v2010->account->shortCodes; } /** * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch */ protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext { return $this->api->v2010->account->shortCodes($sid); } protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { return $this->api->v2010->account->signingKeys; } /** * @param string $sid The sid */ protected function contextSigningKeys(string $sid): \Twilio\Rest\Api\V2010\Account\SigningKeyContext { return $this->api->v2010->account->signingKeys($sid); } protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { return $this->api->v2010->account->sip; } protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { return $this->api->v2010->account->tokens; } protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { return $this->api->v2010->account->transcriptions; } /** * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to fetch. */ protected function contextTranscriptions(string $sid): \Twilio\Rest\Api\V2010\Account\TranscriptionContext { return $this->api->v2010->account->transcriptions($sid); } protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { return $this->api->v2010->account->usage; } protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { return $this->api->v2010->account->validationRequests; } } sdk/src/Twilio/Rest/ApiBase.php000064400000004541150364341760012332 0ustar00baseUrl = 'https://api.twilio.com'; } /** * @return V2010 Version v2010 of api */ protected function getV2010(): V2010 { if (!$this->_v2010) { $this->_v2010 = new V2010($this); } return $this->_v2010; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api]'; } } sdk/src/Twilio/Rest/Voice/V1.php000064400000011251150364341760012355 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkOptions.php000064400000057076150364341760015670 0ustar00options['friendlyName'] = $friendlyName; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; $this->options['connectionPolicySid'] = $connectionPolicySid; $this->options['fromDomainSid'] = $fromDomainSid; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should call when the BYOC Trunk receives a call. * * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @return $this Fluent Builder */ public function setStatusCallbackUrl(string $statusCallbackUrl): self { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @return $this Fluent Builder */ public function setConnectionPolicySid(string $connectionPolicySid): self { $this->options['connectionPolicySid'] = $connectionPolicySid; return $this; } /** * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * @return $this Fluent Builder */ public function setFromDomainSid(string $fromDomainSid): self { $this->options['fromDomainSid'] = $fromDomainSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.CreateByocTrunkOptions ' . $options . ']'; } } class UpdateByocTrunkOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". */ public function __construct( string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $connectionPolicySid = Values::NONE, string $fromDomainSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; $this->options['connectionPolicySid'] = $connectionPolicySid; $this->options['fromDomainSid'] = $fromDomainSid; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should call when the BYOC Trunk receives a call. * * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url` * * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @return $this Fluent Builder */ public function setStatusCallbackUrl(string $statusCallbackUrl): self { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @return $this Fluent Builder */ public function setConnectionPolicySid(string $connectionPolicySid): self { $this->options['connectionPolicySid'] = $connectionPolicySid; return $this; } /** * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * @return $this Fluent Builder */ public function setFromDomainSid(string $fromDomainSid): self { $this->options['fromDomainSid'] = $fromDomainSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateByocTrunkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkInstance.php000064400000012650150364341760015766 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'statusCallbackUrl' => Values::array_get($payload, 'status_callback_url'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), 'connectionPolicySid' => Values::array_get($payload, 'connection_policy_sid'), 'fromDomainSid' => Values::array_get($payload, 'from_domain_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ByocTrunkContext Context for this ByocTrunkInstance */ protected function proxy(): ByocTrunkContext { if (!$this->context) { $this->context = new ByocTrunkContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ByocTrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ByocTrunkInstance * * @return ByocTrunkInstance Fetched ByocTrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ByocTrunkInstance { return $this->proxy()->fetch(); } /** * Update the ByocTrunkInstance * * @param array|Options $options Optional Arguments * @return ByocTrunkInstance Updated ByocTrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ByocTrunkInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ByocTrunkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php000064400000007333150364341760015650 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/ByocTrunks/' . \rawurlencode($sid) .''; } /** * Delete the ByocTrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordOptions.php000064400000012062150364341760015441 0ustar00options['friendlyName'] = $friendlyName; $this->options['cidrPrefixLength'] = $cidrPrefixLength; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. * * @param int $cidrPrefixLength An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. * @return $this Fluent Builder */ public function setCidrPrefixLength(int $cidrPrefixLength): self { $this->options['cidrPrefixLength'] = $cidrPrefixLength; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.CreateIpRecordOptions ' . $options . ']'; } } class UpdateIpRecordOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateIpRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyInstance.php000064400000011404150364341760017321 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConnectionPolicyContext Context for this ConnectionPolicyInstance */ protected function proxy(): ConnectionPolicyContext { if (!$this->context) { $this->context = new ConnectionPolicyContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ConnectionPolicyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ConnectionPolicyInstance * * @return ConnectionPolicyInstance Fetched ConnectionPolicyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectionPolicyInstance { return $this->proxy()->fetch(); } /** * Update the ConnectionPolicyInstance * * @param array|Options $options Optional Arguments * @return ConnectionPolicyInstance Updated ConnectionPolicyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectionPolicyInstance { return $this->proxy()->update($options); } /** * Access the targets */ protected function getTargets(): ConnectionPolicyTargetList { return $this->proxy()->targets; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ConnectionPolicyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyList.php000064400000013764150364341760016503 0ustar00solution = [ ]; $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 ); } /** * Reads ConnectionPolicyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConnectionPolicyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ConnectionPolicyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConnectionPolicyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConnectionPolicyPage Page of ConnectionPolicyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConnectionPolicyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConnectionPolicyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConnectionPolicyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConnectionPolicyPage Page of ConnectionPolicyInstance */ public function getPage(string $targetUrl): ConnectionPolicyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConnectionPolicyPage($this->version, $response, $this->solution); } /** * Constructs a ConnectionPolicyContext * * @param string $sid The unique string that we created to identify the Connection Policy resource to delete. */ public function getContext( string $sid ): ConnectionPolicyContext { return new ConnectionPolicyContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ConnectionPolicyList]'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordPage.php000064400000003014150364341760014657 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkPage.php000064400000003022150364341760015067 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyOptions.php000064400000007561150364341760017221 0ustar00options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.CreateConnectionPolicyOptions ' . $options . ']'; } } class UpdateConnectionPolicyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateConnectionPolicyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyPage.php000064400000003074150364341760016435 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php000064400000006037150364341760016775 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/SourceIpMappings/' . \rawurlencode($sid) .''; } /** * Delete the SourceIpMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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 SID of the SIP Domain that the IP Record should be mapped to. * @return SourceIpMappingInstance Updated SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $sipDomainSid): SourceIpMappingInstance { $data = Values::of([ 'SipDomainSid' => $sipDomainSid, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SourceIpMappingInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.SourceIpMappingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordContext.php000064400000005721150364341760015436 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/IpRecords/' . \rawurlencode($sid) .''; } /** * Delete the IpRecordInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkList.php000064400000015075150364341760015141 0ustar00solution = [ ]; $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 ); } /** * Reads ByocTrunkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ByocTrunkInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ByocTrunkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ByocTrunkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ByocTrunkPage Page of ByocTrunkInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ByocTrunkPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ByocTrunkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ByocTrunkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ByocTrunkPage Page of ByocTrunkInstance */ public function getPage(string $targetUrl): ByocTrunkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ByocTrunkPage($this->version, $response, $this->solution); } /** * Constructs a ByocTrunkContext * * @param string $sid The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete. */ public function getContext( string $sid ): ByocTrunkContext { return new ByocTrunkContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ByocTrunkList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php000064400000003471150364341760017652 0ustar00solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \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]'; } } sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingList.php000064400000014207150364341760016262 0ustar00solution = [ ]; $this->uri = '/SourceIpMappings'; } /** * Create the SourceIpMappingInstance * * @param string $ipRecordSid The Twilio-provided string that uniquely identifies the IP Record resource to map from. * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. * @return SourceIpMappingInstance Created SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $ipRecordSid, string $sipDomainSid): SourceIpMappingInstance { $data = Values::of([ 'IpRecordSid' => $ipRecordSid, 'SipDomainSid' => $sipDomainSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SourceIpMappingInstance( $this->version, $payload ); } /** * Reads SourceIpMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SourceIpMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SourceIpMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SourceIpMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SourceIpMappingPage Page of SourceIpMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SourceIpMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SourceIpMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SourceIpMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SourceIpMappingPage Page of SourceIpMappingInstance */ public function getPage(string $targetUrl): SourceIpMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SourceIpMappingPage($this->version, $response, $this->solution); } /** * Constructs a SourceIpMappingContext * * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. */ public function getContext( string $sid ): SourceIpMappingContext { return new SourceIpMappingContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.SourceIpMappingList]'; } } sdk/src/Twilio/Rest/Voice/V1/ArchivedCallContext.php000064400000004021150364341760016240 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php000064400000003252150364341760023061 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php000064400000007463150364341760023641 0ustar00solution = [ 'connectionPolicySid' => $connectionPolicySid, 'sid' => $sid, ]; $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) .'/Targets/' . \rawurlencode($sid) .''; } /** * Delete the ConnectionPolicyTargetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php000064400000015670150364341760023127 0ustar00solution = [ 'connectionPolicySid' => $connectionPolicySid, ]; $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) .'/Targets'; } /** * Create the ConnectionPolicyTargetInstance * * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * @param array|Options $options Optional Arguments * @return ConnectionPolicyTargetInstance Created ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $target, array $options = []): ConnectionPolicyTargetInstance { $options = new Values($options); $data = Values::of([ 'Target' => $target, 'FriendlyName' => $options['friendlyName'], 'Priority' => $options['priority'], 'Weight' => $options['weight'], 'Enabled' => Serialize::booleanToString($options['enabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ConnectionPolicyTargetInstance( $this->version, $payload, $this->solution['connectionPolicySid'] ); } /** * Reads ConnectionPolicyTargetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConnectionPolicyTargetInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ConnectionPolicyTargetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConnectionPolicyTargetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConnectionPolicyTargetPage Page of ConnectionPolicyTargetInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConnectionPolicyTargetPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConnectionPolicyTargetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConnectionPolicyTargetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConnectionPolicyTargetPage Page of ConnectionPolicyTargetInstance */ public function getPage(string $targetUrl): ConnectionPolicyTargetPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConnectionPolicyTargetPage($this->version, $response, $this->solution); } /** * Constructs a ConnectionPolicyTargetContext * * @param string $sid The unique string that we created to identify the Target resource to delete. */ public function getContext( string $sid ): ConnectionPolicyTargetContext { return new ConnectionPolicyTargetContext( $this->version, $this->solution['connectionPolicySid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ConnectionPolicyTargetList]'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php000064400000026125150364341760023644 0ustar00options['friendlyName'] = $friendlyName; $this->options['priority'] = $priority; $this->options['weight'] = $weight; $this->options['enabled'] = $enabled; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. * * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. * * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. * @return $this Fluent Builder */ public function setWeight(int $weight): self { $this->options['weight'] = $weight; return $this; } /** * Whether the Target is enabled. The default is `true`. * * @param bool $enabled Whether the Target is enabled. The default is `true`. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.CreateConnectionPolicyTargetOptions ' . $options . ']'; } } class UpdateConnectionPolicyTargetOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. * @param bool $enabled Whether the Target is enabled. */ public function __construct( string $friendlyName = Values::NONE, string $target = Values::NONE, int $priority = Values::INT_NONE, int $weight = Values::INT_NONE, bool $enabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['target'] = $target; $this->options['priority'] = $priority; $this->options['weight'] = $weight; $this->options['enabled'] = $enabled; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * @return $this Fluent Builder */ public function setTarget(string $target): self { $this->options['target'] = $target; return $this; } /** * The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. * * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. * * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. * @return $this Fluent Builder */ public function setWeight(int $weight): self { $this->options['weight'] = $weight; return $this; } /** * Whether the Target is enabled. * * @param bool $enabled Whether the Target is enabled. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateConnectionPolicyTargetOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php000064400000012376150364341760023760 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'connectionPolicySid' => Values::array_get($payload, 'connection_policy_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'target' => Values::array_get($payload, 'target'), 'priority' => Values::array_get($payload, 'priority'), 'weight' => Values::array_get($payload, 'weight'), 'enabled' => Values::array_get($payload, 'enabled'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['connectionPolicySid' => $connectionPolicySid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConnectionPolicyTargetContext Context for this ConnectionPolicyTargetInstance */ protected function proxy(): ConnectionPolicyTargetContext { if (!$this->context) { $this->context = new ConnectionPolicyTargetContext( $this->version, $this->solution['connectionPolicySid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ConnectionPolicyTargetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ConnectionPolicyTargetInstance * * @return ConnectionPolicyTargetInstance Fetched ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectionPolicyTargetInstance { return $this->proxy()->fetch(); } /** * Update the ConnectionPolicyTargetInstance * * @param array|Options $options Optional Arguments * @return ConnectionPolicyTargetInstance Updated ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectionPolicyTargetInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ConnectionPolicyTargetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ArchivedCallList.php000064400000003150150364341760015531 0ustar00solution = [ ]; } /** * Constructs a ArchivedCallContext * * @param \DateTime $date The date of the Call in UTC. * * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete */ public function getContext( \DateTime $date , string $sid ): ArchivedCallContext { return new ArchivedCallContext( $this->version, $date, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ArchivedCallList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsPage.php000064400000003110150364341760016750 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordList.php000064400000014030150364341760014716 0ustar00solution = [ ]; $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 ); } /** * Reads IpRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpRecordInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpRecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpRecordPage Page of IpRecordInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpRecordPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpRecordPage Page of IpRecordInstance */ public function getPage(string $targetUrl): IpRecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpRecordPage($this->version, $response, $this->solution); } /** * Constructs a IpRecordContext * * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. */ public function getContext( string $sid ): IpRecordContext { return new IpRecordContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.IpRecordList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsList.php000064400000007447150364341760017030 0ustar00solution = [ ]; } /** * Access the bulkCountryUpdates */ protected function getBulkCountryUpdates(): BulkCountryUpdateList { if (!$this->_bulkCountryUpdates) { $this->_bulkCountryUpdates = new BulkCountryUpdateList( $this->version ); } return $this->_bulkCountryUpdates; } /** * Access the countries */ protected function getCountries(): CountryList { if (!$this->_countries) { $this->_countries = new CountryList( $this->version ); } return $this->_countries; } /** * Access the settings */ protected function getSettings(): SettingsList { if (!$this->_settings) { $this->_settings = new SettingsList( $this->version ); } return $this->_settings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.DialingPermissionsList]'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordInstance.php000064400000011016150364341760015550 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'ipAddress' => Values::array_get($payload, 'ip_address'), 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_length'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpRecordContext Context for this IpRecordInstance */ protected function proxy(): IpRecordContext { if (!$this->context) { $this->context = new IpRecordContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the IpRecordInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpRecordInstance * * @return IpRecordInstance Fetched IpRecordInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpRecordInstance { return $this->proxy()->fetch(); } /** * Update the IpRecordInstance * * @param array|Options $options Optional Arguments * @return IpRecordInstance Updated IpRecordInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IpRecordInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.IpRecordInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingPage.php000064400000003066150364341760016224 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingInstance.php000064400000010673150364341760017116 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'ipRecordSid' => Values::array_get($payload, 'ip_record_sid'), 'sipDomainSid' => Values::array_get($payload, 'sip_domain_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SourceIpMappingContext Context for this SourceIpMappingInstance */ protected function proxy(): SourceIpMappingContext { if (!$this->context) { $this->context = new SourceIpMappingContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SourceIpMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SourceIpMappingInstance * * @return SourceIpMappingInstance Fetched SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SourceIpMappingInstance { return $this->proxy()->fetch(); } /** * Update the SourceIpMappingInstance * * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. * @return SourceIpMappingInstance Updated SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $sipDomainSid): SourceIpMappingInstance { return $this->proxy()->update($sipDomainSid); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.SourceIpMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php000064400000011446150364341760017207 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/ConnectionPolicies/' . \rawurlencode($sid) .''; } /** * Delete the ConnectionPolicyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * 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'] ); } /** * 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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php000064400000006632150364341760021454 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php000064400000007464150364341760021203 0ustar00solution = [ '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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php000064400000003062150364341760020556 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php000064400000003054150364341760020422 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php000064400000004221150364341760023270 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php000064400000010647150364341760021320 0ustar00properties = [ '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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php000064400000003150150364341760022400 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php000064400000017242150364341760021205 0ustar00options['isoCode'] = $isoCode; $this->options['continent'] = $continent; $this->options['countryCode'] = $countryCode; $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; } /** * Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) * * @param string $isoCode Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) * @return $this Fluent Builder */ public function setIsoCode(string $isoCode): self { $this->options['isoCode'] = $isoCode; return $this; } /** * Filter to retrieve the country permissions by specifying the continent * * @param string $continent Filter to retrieve the country permissions by specifying the continent * @return $this Fluent Builder */ public function setContinent(string $continent): self { $this->options['continent'] = $continent; return $this; } /** * Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) * * @param string $countryCode Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) * @return $this Fluent Builder */ public function setCountryCode(string $countryCode): self { $this->options['countryCode'] = $countryCode; return $this; } /** * Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. * * @param bool $lowRiskNumbersEnabled Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setLowRiskNumbersEnabled(bool $lowRiskNumbersEnabled): self { $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; return $this; } /** * Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` * * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` * @return $this Fluent Builder */ public function setHighRiskSpecialNumbersEnabled(bool $highRiskSpecialNumbersEnabled): self { $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; return $this; } /** * Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. * * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setHighRiskTollfraudNumbersEnabled(bool $highRiskTollfraudNumbersEnabled): self { $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.ReadCountryOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php000064400000012545150364341760024715 0ustar00solution = [ 'isoCode' => $isoCode, ]; $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) .'/HighRiskSpecialPrefixes'; } /** * Reads HighriskSpecialPrefixInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return HighriskSpecialPrefixInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams HighriskSpecialPrefixInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of HighriskSpecialPrefixInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return HighriskSpecialPrefixPage Page of HighriskSpecialPrefixInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): HighriskSpecialPrefixPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of HighriskSpecialPrefixInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return HighriskSpecialPrefixPage Page of HighriskSpecialPrefixInstance */ public function getPage(string $targetUrl): HighriskSpecialPrefixPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.HighriskSpecialPrefixList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php000064400000003254150364341760024653 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php000064400000004435150364341760025545 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php000064400000004561150364341760021342 0ustar00options['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 . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php000064400000005013150364341760021324 0ustar00solution = [ ]; $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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php000064400000004212150364341760022437 0ustar00solution = [ ]; $this->uri = '/DialingPermissions/BulkCountryUpdates'; } /** * Create the BulkCountryUpdateInstance * * @param string $updateRequest URL encoded JSON array of update objects. example : `[ { \\\"iso_code\\\": \\\"GB\\\", \\\"low_risk_numbers_enabled\\\": \\\"true\\\", \\\"high_risk_special_numbers_enabled\\\":\\\"true\\\", \\\"high_risk_tollfraud_numbers_enabled\\\": \\\"false\\\" } ]` * @return BulkCountryUpdateInstance Created BulkCountryUpdateInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $updateRequest): BulkCountryUpdateInstance { $data = Values::of([ 'UpdateRequest' => $updateRequest, ]); $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]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php000064400000002533150364341760020617 0ustar00solution = [ ]; } /** * 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]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php000064400000014040150364341760020456 0ustar00solution = [ ]; $this->uri = '/DialingPermissions/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $options = new Values($options); $params = Values::of([ 'IsoCode' => $options['isoCode'], 'Continent' => $options['continent'], 'CountryCode' => $options['countryCode'], 'LowRiskNumbersEnabled' => Serialize::booleanToString($options['lowRiskNumbersEnabled']), 'HighRiskSpecialNumbersEnabled' => Serialize::booleanToString($options['highRiskSpecialNumbersEnabled']), 'HighRiskTollfraudNumbersEnabled' => Serialize::booleanToString($options['highRiskTollfraudNumbersEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch */ public function getContext( string $isoCode ): CountryContext { return new CountryContext( $this->version, $isoCode ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.CountryList]'; } } sdk/src/Twilio/Rest/Voice/V1/ArchivedCallInstance.php000064400000006104150364341760016364 0ustar00solution = ['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) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ArchivedCallPage.php000064400000003044150364341760015474 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Trusthub.php000064400000011615150364341760012646 0ustar00customerProfiles instead. */ protected function getCustomerProfiles(): \Twilio\Rest\Trusthub\V1\CustomerProfilesList { echo "customerProfiles is deprecated. Use v1->customerProfiles instead."; return $this->v1->customerProfiles; } /** * @deprecated Use v1->customerProfiles(\$sid) instead. * @param string $sid The unique string that identifies the resource. */ protected function contextCustomerProfiles(string $sid): \Twilio\Rest\Trusthub\V1\CustomerProfilesContext { echo "customerProfiles(\$sid) is deprecated. Use v1->customerProfiles(\$sid) instead."; return $this->v1->customerProfiles($sid); } /** * @deprecated Use v1->endUsers instead. */ protected function getEndUsers(): \Twilio\Rest\Trusthub\V1\EndUserList { echo "endUsers is deprecated. Use v1->endUsers instead."; return $this->v1->endUsers; } /** * @deprecated Use v1->endUsers(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextEndUsers(string $sid): \Twilio\Rest\Trusthub\V1\EndUserContext { echo "endUsers(\$sid) is deprecated. Use v1->endUsers(\$sid) instead."; return $this->v1->endUsers($sid); } /** * @deprecated Use v1->endUserTypes instead. */ protected function getEndUserTypes(): \Twilio\Rest\Trusthub\V1\EndUserTypeList { echo "endUserTypes is deprecated. Use v1->endUserTypes instead."; return $this->v1->endUserTypes; } /** * @deprecated Use v1->endUserTypes(\$sid) instead. * @param string $sid The unique string that identifies the End-User Type * resource */ protected function contextEndUserTypes(string $sid): \Twilio\Rest\Trusthub\V1\EndUserTypeContext { echo "endUserTypes(\$sid) is deprecated. Use v1->endUserTypes(\$sid) instead."; return $this->v1->endUserTypes($sid); } /** * @deprecated Use v1->policies instead. */ protected function getPolicies(): \Twilio\Rest\Trusthub\V1\PoliciesList { echo "policies is deprecated. Use v1->policies instead."; return $this->v1->policies; } /** * @deprecated Use v1->policies(\$sid) instead. * @param string $sid The unique string that identifies the Policy resource */ protected function contextPolicies(string $sid): \Twilio\Rest\Trusthub\V1\PoliciesContext { echo "policies(\$sid) is deprecated. Use v1->policies(\$sid) instead."; return $this->v1->policies($sid); } /** * @deprecated Use v1->supportingDocuments instead. */ protected function getSupportingDocuments(): \Twilio\Rest\Trusthub\V1\SupportingDocumentList { echo "supportingDocuments is deprecated. Use v1->supportingDocuments instead."; return $this->v1->supportingDocuments; } /** * @deprecated Use v1->supportingDocuments(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextSupportingDocuments(string $sid): \Twilio\Rest\Trusthub\V1\SupportingDocumentContext { echo "supportingDocuments(\$sid) is deprecated. Use v1->supportingDocuments(\$sid) instead."; return $this->v1->supportingDocuments($sid); } /** * @deprecated Use v1->supportingDocumentTypes instead. */ protected function getSupportingDocumentTypes(): \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeList { echo "supportingDocumentTypes is deprecated. Use v1->supportingDocumentTypes instead."; return $this->v1->supportingDocumentTypes; } /** * @deprecated Use v1->supportingDocumentTypes(\$sid) instead. * @param string $sid The unique string that identifies the Supporting Document * Type resource */ protected function contextSupportingDocumentTypes(string $sid): \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeContext { echo "supportingDocumentTypes(\$sid) is deprecated. Use v1->supportingDocumentTypes(\$sid) instead."; return $this->v1->supportingDocumentTypes($sid); } /** * @deprecated Use v1->trustProducts instead. */ protected function getTrustProducts(): \Twilio\Rest\Trusthub\V1\TrustProductsList { echo "trustProducts is deprecated. Use v1->trustProducts instead."; return $this->v1->trustProducts; } /** * @deprecated Use v1->trustProducts(\$sid) instead. * @param string $sid The unique string that identifies the resource. */ protected function contextTrustProducts(string $sid): \Twilio\Rest\Trusthub\V1\TrustProductsContext { echo "trustProducts(\$sid) is deprecated. Use v1->trustProducts(\$sid) instead."; return $this->v1->trustProducts($sid); } }sdk/src/Twilio/Rest/Notify/V1.php000064400000005706150364341760012570 0ustar00version = '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]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingContext.php000064400000005074150364341760017105 0ustar00solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/Service/NotificationList.php000064400000007116150364341760017447 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Notifications'; } /** * Create the NotificationInstance * * @param array|Options $options Optional Arguments * @return NotificationInstance Created NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): NotificationInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Priority' => $options['priority'], 'Ttl' => $options['ttl'], 'Title' => $options['title'], 'Sound' => $options['sound'], 'Action' => $options['action'], 'Data' => Serialize::jsonObject($options['data']), 'Apn' => Serialize::jsonObject($options['apn']), 'Gcm' => Serialize::jsonObject($options['gcm']), 'Sms' => Serialize::jsonObject($options['sms']), 'FacebookMessenger' => Serialize::jsonObject($options['facebookMessenger']), 'Fcm' => Serialize::jsonObject($options['fcm']), 'Segment' => Serialize::map($options['segment'], function ($e) { return $e; }), 'Alexa' => Serialize::jsonObject($options['alexa']), 'ToBinding' => Serialize::map($options['toBinding'], function ($e) { return $e; }), 'DeliveryCallbackUrl' => $options['deliveryCallbackUrl'], 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'Tag' => Serialize::map($options['tag'], function ($e) { return $e; }), ]); $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]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/NotificationInstance.php000064400000010025150364341760020271 0ustar00properties = [ '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]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/NotificationPage.php000064400000003127150364341760017406 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingOptions.php000064400000025557150364341760017124 0ustar00options['tag'] = $tag; $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; $this->options['credentialSid'] = $credentialSid; $this->options['endpoint'] = $endpoint; } /** * A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. * * @param string[] $tag A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. * @return $this Fluent Builder */ public function setTag(array $tag): self { $this->options['tag'] = $tag; return $this; } /** * The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` for the protocol in the [Service](https://www.twilio.com/docs/notify/api/service-resource). The current version is `\\\"3\\\"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. * * @param string $notificationProtocolVersion The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` for the protocol in the [Service](https://www.twilio.com/docs/notify/api/service-resource). The current version is `\\\"3\\\"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. * @return $this Fluent Builder */ public function setNotificationProtocolVersion(string $notificationProtocolVersion): self { $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only `apn`, `fcm`, and `gcm` type Bindings. * * @param string $credentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only `apn`, `fcm`, and `gcm` type Bindings. * @return $this Fluent Builder */ public function setCredentialSid(string $credentialSid): self { $this->options['credentialSid'] = $credentialSid; return $this; } /** * Deprecated. * * @param string $endpoint Deprecated. * @return $this Fluent Builder */ public function setEndpoint(string $endpoint): self { $this->options['endpoint'] = $endpoint; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Notify.V1.CreateBindingOptions ' . $options . ']'; } } class ReadBindingOptions extends Options { /** * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. * @param string[] $tag Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. */ public function __construct( \DateTime $startDate = null, \DateTime $endDate = null, array $identity = Values::ARRAY_NONE, array $tag = Values::ARRAY_NONE ) { $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['identity'] = $identity; $this->options['tag'] = $tag; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. * * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. * * @param string[] $tag Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. * @return $this Fluent Builder */ public function setTag(array $tag): self { $this->options['tag'] = $tag; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Notify.V1.ReadBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingInstance.php000064400000012003150364341760017213 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'notificationProtocolVersion' => Values::array_get($payload, 'notification_protocol_version'), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'address' => Values::array_get($payload, 'address'), 'tags' => Values::array_get($payload, 'tags'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BindingContext Context for this BindingInstance */ protected function proxy(): BindingContext { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.php000064400000073676150364341760020205 0ustar00options['identity'] = $identity; $this->options['tag'] = $tag; $this->options['body'] = $body; $this->options['priority'] = $priority; $this->options['ttl'] = $ttl; $this->options['title'] = $title; $this->options['sound'] = $sound; $this->options['action'] = $action; $this->options['data'] = $data; $this->options['apn'] = $apn; $this->options['gcm'] = $gcm; $this->options['sms'] = $sms; $this->options['facebookMessenger'] = $facebookMessenger; $this->options['fcm'] = $fcm; $this->options['segment'] = $segment; $this->options['alexa'] = $alexa; $this->options['toBinding'] = $toBinding; $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; } /** * The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. * * @param string[] $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag `all` is available to notify all Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings in a specific channel. * * @param string[] $tag A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag `all` is available to notify all Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings in a specific channel. * @return $this Fluent Builder */ public function setTag(array $tag): self { $this->options['tag'] = $tag; return $this; } /** * The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. * * @param string $body The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * @param string $priority * @return $this Fluent Builder */ public function setPriority(string $priority): self { $this->options['priority'] = $priority; return $this; } /** * How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. * * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. * * @param string $title The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. * @return $this Fluent Builder */ public function setTitle(string $title): self { $this->options['title'] = $title; return $this; } /** * The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. * * @param string $sound The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. * @return $this Fluent Builder */ public function setSound(string $sound): self { $this->options['sound'] = $sound; return $this; } /** * The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. * * @param string $action The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. * @return $this Fluent Builder */ public function setAction(string $action): self { $this->options['action'] = $action; return $this; } /** * The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. * * @param array $data The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. * * @param array $apn The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. * @return $this Fluent Builder */ public function setApn(array $apn): self { $this->options['apn'] = $apn; return $this; } /** * The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). * * @param array $gcm The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). * @return $this Fluent Builder */ public function setGcm(array $gcm): self { $this->options['gcm'] = $gcm; return $this; } /** * The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/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 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. * @return $this Fluent Builder */ public function setSms(array $sms): self { $this->options['sms'] = $sms; return $this; } /** * Deprecated. * * @param array $facebookMessenger Deprecated. * @return $this Fluent Builder */ public function setFacebookMessenger(array $facebookMessenger): self { $this->options['facebookMessenger'] = $facebookMessenger; return $this; } /** * The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. * * @param array $fcm The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. * @return $this Fluent Builder */ public function setFcm(array $fcm): self { $this->options['fcm'] = $fcm; return $this; } /** * The Segment resource is deprecated. Use the `tag` parameter, instead. * * @param string[] $segment The Segment resource is deprecated. Use the `tag` parameter, instead. * @return $this Fluent Builder */ public function setSegment(array $segment): self { $this->options['segment'] = $segment; return $this; } /** * Deprecated. * * @param array $alexa Deprecated. * @return $this Fluent Builder */ public function setAlexa(array $alexa): self { $this->options['alexa'] = $alexa; return $this; } /** * The destination address specified as a JSON string. Multiple `to_binding` parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. * * @param string[] $toBinding The destination address specified as a JSON string. Multiple `to_binding` parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. * @return $this Fluent Builder */ public function setToBinding(array $toBinding): self { $this->options['toBinding'] = $toBinding; return $this; } /** * URL to send webhooks. * * @param string $deliveryCallbackUrl URL to send webhooks. * @return $this Fluent Builder */ public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self { $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Notify.V1.CreateNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingList.php000064400000017526150364341760016401 0ustar00solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings'; } /** * Create the BindingInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Up to 20 Bindings can be created for the same Identity in a given Service. * @param string $bindingType * @param string $address The channel-specific address. For APNS, the device token. For FCM and GCM, the registration token. For SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger ID of the user or a phone number in E.164 format. * @param array|Options $options Optional Arguments * @return BindingInstance Created BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, string $bindingType, string $address, array $options = []): BindingInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'BindingType' => $bindingType, 'Address' => $address, 'Tag' => Serialize::map($options['tag'], function ($e) { return $e; }), 'NotificationProtocolVersion' => $options['notificationProtocolVersion'], 'CredentialSid' => $options['credentialSid'], 'Endpoint' => $options['endpoint'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BindingPage Page of BindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BindingPage { $options = new Values($options); $params = Values::of([ 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'Tag' => Serialize::map($options['tag'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BindingPage Page of BindingInstance */ public function getPage(string $targetUrl): BindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid The Twilio-provided string that uniquely identifies the Binding resource to delete. */ public function getContext( string $sid ): BindingContext { return new BindingContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Notify.V1.BindingList]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingPage.php000064400000003071150364341760016330 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Notify/V1/ServiceOptions.php000064400000077267150364341760015557 0ustar00options['friendlyName'] = $friendlyName; $this->options['apnCredentialSid'] = $apnCredentialSid; $this->options['gcmCredentialSid'] = $gcmCredentialSid; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; $this->options['fcmCredentialSid'] = $fcmCredentialSid; $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; $this->options['logEnabled'] = $logEnabled; $this->options['alexaSkillId'] = $alexaSkillId; $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. * * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. * @return $this Fluent Builder */ public function setApnCredentialSid(string $apnCredentialSid): self { $this->options['apnCredentialSid'] = $apnCredentialSid; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. * * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. * @return $this Fluent Builder */ public function setGcmCredentialSid(string $gcmCredentialSid): self { $this->options['gcmCredentialSid'] = $gcmCredentialSid; return $this; } /** * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/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](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. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * Deprecated. * * @param string $facebookMessengerPageId Deprecated. * @return $this Fluent Builder */ public function setFacebookMessengerPageId(string $facebookMessengerPageId): self { $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; return $this; } /** * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @return $this Fluent Builder */ public function setDefaultApnNotificationProtocolVersion(string $defaultApnNotificationProtocolVersion): self { $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; return $this; } /** * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @return $this Fluent Builder */ public function setDefaultGcmNotificationProtocolVersion(string $defaultGcmNotificationProtocolVersion): self { $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. * * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. * @return $this Fluent Builder */ public function setFcmCredentialSid(string $fcmCredentialSid): self { $this->options['fcmCredentialSid'] = $fcmCredentialSid; return $this; } /** * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @return $this Fluent Builder */ public function setDefaultFcmNotificationProtocolVersion(string $defaultFcmNotificationProtocolVersion): self { $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; return $this; } /** * Whether to log notifications. Can be: `true` or `false` and the default is `true`. * * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setLogEnabled(bool $logEnabled): self { $this->options['logEnabled'] = $logEnabled; return $this; } /** * Deprecated. * * @param string $alexaSkillId Deprecated. * @return $this Fluent Builder */ public function setAlexaSkillId(string $alexaSkillId): self { $this->options['alexaSkillId'] = $alexaSkillId; return $this; } /** * Deprecated. * * @param string $defaultAlexaNotificationProtocolVersion Deprecated. * @return $this Fluent Builder */ public function setDefaultAlexaNotificationProtocolVersion(string $defaultAlexaNotificationProtocolVersion): self { $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; return $this; } /** * URL to send delivery status callback. * * @param string $deliveryCallbackUrl URL to send delivery status callback. * @return $this Fluent Builder */ public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self { $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; return $this; } /** * Callback configuration that enables delivery callbacks, default false * * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false * @return $this Fluent Builder */ public function setDeliveryCallbackEnabled(bool $deliveryCallbackEnabled): self { $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Notify.V1.CreateServiceOptions ' . $options . ']'; } } class ReadServiceOptions extends Options { /** * @param string $friendlyName The string that identifies the Service resources to read. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * The string that identifies the Service resources to read. * * @param string $friendlyName The string that identifies the Service resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Notify.V1.ReadServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. * @param string $facebookMessengerPageId Deprecated. * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. * @param string $alexaSkillId Deprecated. * @param string $defaultAlexaNotificationProtocolVersion Deprecated. * @param string $deliveryCallbackUrl URL to send delivery status callback. * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false */ public function __construct( string $friendlyName = Values::NONE, string $apnCredentialSid = Values::NONE, string $gcmCredentialSid = Values::NONE, string $messagingServiceSid = Values::NONE, string $facebookMessengerPageId = Values::NONE, string $defaultApnNotificationProtocolVersion = Values::NONE, string $defaultGcmNotificationProtocolVersion = Values::NONE, string $fcmCredentialSid = Values::NONE, string $defaultFcmNotificationProtocolVersion = Values::NONE, bool $logEnabled = Values::BOOL_NONE, string $alexaSkillId = Values::NONE, string $defaultAlexaNotificationProtocolVersion = Values::NONE, string $deliveryCallbackUrl = Values::NONE, bool $deliveryCallbackEnabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['apnCredentialSid'] = $apnCredentialSid; $this->options['gcmCredentialSid'] = $gcmCredentialSid; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; $this->options['fcmCredentialSid'] = $fcmCredentialSid; $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; $this->options['logEnabled'] = $logEnabled; $this->options['alexaSkillId'] = $alexaSkillId; $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. * * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. * @return $this Fluent Builder */ public function setApnCredentialSid(string $apnCredentialSid): self { $this->options['apnCredentialSid'] = $apnCredentialSid; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. * * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. * @return $this Fluent Builder */ public function setGcmCredentialSid(string $gcmCredentialSid): self { $this->options['gcmCredentialSid'] = $gcmCredentialSid; return $this; } /** * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/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](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. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * Deprecated. * * @param string $facebookMessengerPageId Deprecated. * @return $this Fluent Builder */ public function setFacebookMessengerPageId(string $facebookMessengerPageId): self { $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; return $this; } /** * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @return $this Fluent Builder */ public function setDefaultApnNotificationProtocolVersion(string $defaultApnNotificationProtocolVersion): self { $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; return $this; } /** * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @return $this Fluent Builder */ public function setDefaultGcmNotificationProtocolVersion(string $defaultGcmNotificationProtocolVersion): self { $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. * * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. * @return $this Fluent Builder */ public function setFcmCredentialSid(string $fcmCredentialSid): self { $this->options['fcmCredentialSid'] = $fcmCredentialSid; return $this; } /** * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * @return $this Fluent Builder */ public function setDefaultFcmNotificationProtocolVersion(string $defaultFcmNotificationProtocolVersion): self { $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; return $this; } /** * Whether to log notifications. Can be: `true` or `false` and the default is `true`. * * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setLogEnabled(bool $logEnabled): self { $this->options['logEnabled'] = $logEnabled; return $this; } /** * Deprecated. * * @param string $alexaSkillId Deprecated. * @return $this Fluent Builder */ public function setAlexaSkillId(string $alexaSkillId): self { $this->options['alexaSkillId'] = $alexaSkillId; return $this; } /** * Deprecated. * * @param string $defaultAlexaNotificationProtocolVersion Deprecated. * @return $this Fluent Builder */ public function setDefaultAlexaNotificationProtocolVersion(string $defaultAlexaNotificationProtocolVersion): self { $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; return $this; } /** * URL to send delivery status callback. * * @param string $deliveryCallbackUrl URL to send delivery status callback. * @return $this Fluent Builder */ public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self { $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; return $this; } /** * Callback configuration that enables delivery callbacks, default false * * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false * @return $this Fluent Builder */ public function setDeliveryCallbackEnabled(bool $deliveryCallbackEnabled): self { $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Notify.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialList.php000064400000014447150364341760015500 0ustar00solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Notify.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Notify/V1/ServiceList.php000064400000016553150364341760015026 0ustar00solution = [ ]; $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 ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Notify.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Notify/V1/ServicePage.php000064400000003012150364341760014751 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialOptions.php000064400000034555150364341760016222 0ustar00options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Notify.V1.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Notify.V1.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialInstance.php000064400000011003150364341760016312 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/ServiceContext.php000064400000014510150364341760015526 0ustar00solution = [ '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 notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['sid'] ); } return $this->_notifications; } /** * Access the bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList( $this->version, $this->solution['sid'] ); } return $this->_bindings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialPage.php000064400000003034150364341760015427 0ustar00solution = $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]'; } } sdk/src/Twilio/Rest/Notify/V1/ServiceInstance.php000064400000015357150364341760015660 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'apnCredentialSid' => Values::array_get($payload, 'apn_credential_sid'), 'gcmCredentialSid' => Values::array_get($payload, 'gcm_credential_sid'), 'fcmCredentialSid' => Values::array_get($payload, 'fcm_credential_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'facebookMessengerPageId' => Values::array_get($payload, 'facebook_messenger_page_id'), 'defaultApnNotificationProtocolVersion' => Values::array_get($payload, 'default_apn_notification_protocol_version'), 'defaultGcmNotificationProtocolVersion' => Values::array_get($payload, 'default_gcm_notification_protocol_version'), 'defaultFcmNotificationProtocolVersion' => Values::array_get($payload, 'default_fcm_notification_protocol_version'), 'logEnabled' => Values::array_get($payload, 'log_enabled'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'alexaSkillId' => Values::array_get($payload, 'alexa_skill_id'), 'defaultAlexaNotificationProtocolVersion' => Values::array_get($payload, 'default_alexa_notification_protocol_version'), 'deliveryCallbackUrl' => Values::array_get($payload, 'delivery_callback_url'), 'deliveryCallbackEnabled' => Values::array_get($payload, 'delivery_callback_enabled'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Access the bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialContext.php000064400000006545150364341760016211 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { 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'] ); } /** * 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'] ); } /** * Provide 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) . ']'; } } sdk/src/Twilio/Rest/PreviewBase.php000064400000010536150364341760013243 0ustar00baseUrl = 'https://preview.twilio.com'; } /** * @return DeployedDevices Version deployedDevices of preview */ protected function getDeployedDevices(): DeployedDevices { if (!$this->_deployedDevices) { $this->_deployedDevices = new DeployedDevices($this); } return $this->_deployedDevices; } /** * @return HostedNumbers Version hostedNumbers of preview */ protected function getHostedNumbers(): HostedNumbers { if (!$this->_hostedNumbers) { $this->_hostedNumbers = new HostedNumbers($this); } return $this->_hostedNumbers; } /** * @return Sync Version sync of preview */ protected function getSync(): Sync { if (!$this->_sync) { $this->_sync = new Sync($this); } return $this->_sync; } /** * @return Marketplace Version marketplace of preview */ protected function getMarketplace(): Marketplace { if (!$this->_marketplace) { $this->_marketplace = new Marketplace($this); } return $this->_marketplace; } /** * @return Understand Version understand of preview */ protected function getUnderstand(): Understand { if (!$this->_understand) { $this->_understand = new Understand($this); } return $this->_understand; } /** * @return Wireless Version wireless of preview */ protected function getWireless(): Wireless { if (!$this->_wireless) { $this->_wireless = new Wireless($this); } return $this->_wireless; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview]'; } } sdk/src/Twilio/Rest/Verify.php000064400000007104150364341760012270 0ustar00forms instead. */ protected function getForms(): \Twilio\Rest\Verify\V2\FormList { echo "forms is deprecated. Use v2->forms instead."; return $this->v2->forms; } /** * @deprecated Use v2->forms(\$formType) instead. * @param string $formType The Type of this Form */ protected function contextForms(string $formType): \Twilio\Rest\Verify\V2\FormContext { echo "forms(\$formType) is deprecated. Use v2->forms(\$formType) instead."; return $this->v2->forms($formType); } /** * @deprecated Use v2->safelist instead. */ protected function getSafelist(): \Twilio\Rest\Verify\V2\SafelistList { echo "safelist is deprecated. Use v2->safelist instead."; return $this->v2->safelist; } /** * @deprecated Use v2->safelist(\$phoneNumber) instead. * @param string $phoneNumber The phone number to be fetched from SafeList. */ protected function contextSafelist(string $phoneNumber): \Twilio\Rest\Verify\V2\SafelistContext { echo "safelist(\$phoneNumber) is deprecated. Use v2->safelist(\$phoneNumber) instead."; return $this->v2->safelist($phoneNumber); } /** * @deprecated Use v2->services instead. */ protected function getServices(): \Twilio\Rest\Verify\V2\ServiceList { echo "services is deprecated. Use v2->services instead."; return $this->v2->services; } /** * @deprecated Use v2->services(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextServices(string $sid): \Twilio\Rest\Verify\V2\ServiceContext { echo "services(\$sid) is deprecated. Use v2->services(\$sid) instead."; return $this->v2->services($sid); } /** * @deprecated Use v2->verificationAttempts instead. */ protected function getVerificationAttempts(): \Twilio\Rest\Verify\V2\VerificationAttemptList { echo "verificationAttempts is deprecated. Use v2->verificationAttempts instead."; return $this->v2->verificationAttempts; } /** * @deprecated Use v2->verificationAttempts(\$sid) instead. * @param string $sid Verification Attempt Sid. */ protected function contextVerificationAttempts(string $sid): \Twilio\Rest\Verify\V2\VerificationAttemptContext { echo "verificationAttempts(\$sid) is deprecated. Use v2->verificationAttempts(\$sid) instead."; return $this->v2->verificationAttempts($sid); } /** * @deprecated Use v2->verificationAttemptsSummary instead. */ protected function getVerificationAttemptsSummary(): \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryList { echo "verificationAttemptsSummary is deprecated. Use v2->verificationAttemptsSummary instead."; return $this->v2->verificationAttemptsSummary; } /** * @deprecated Use v2->verificationAttemptsSummary() instead. */ protected function contextVerificationAttemptsSummary(): \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryContext { echo "verificationAttemptsSummary() is deprecated. Use v2->verificationAttemptsSummary() instead."; return $this->v2->verificationAttemptsSummary(); } /** * @deprecated Use v2->templates instead. */ protected function getTemplates(): \Twilio\Rest\Verify\V2\TemplateList { echo "templates is deprecated. Use v2->templates instead."; return $this->v2->templates; } }sdk/src/Twilio/Rest/Supersim/V1.php000064400000013145150364341760013123 0ustar00version = 'v1'; } protected function getEsimProfiles(): EsimProfileList { if (!$this->_esimProfiles) { $this->_esimProfiles = new EsimProfileList($this); } return $this->_esimProfiles; } protected function getFleets(): FleetList { if (!$this->_fleets) { $this->_fleets = new FleetList($this); } return $this->_fleets; } protected function getIpCommands(): IpCommandList { if (!$this->_ipCommands) { $this->_ipCommands = new IpCommandList($this); } return $this->_ipCommands; } protected function getNetworks(): NetworkList { if (!$this->_networks) { $this->_networks = new NetworkList($this); } return $this->_networks; } protected function getNetworkAccessProfiles(): NetworkAccessProfileList { if (!$this->_networkAccessProfiles) { $this->_networkAccessProfiles = new NetworkAccessProfileList($this); } return $this->_networkAccessProfiles; } protected function getSettingsUpdates(): SettingsUpdateList { if (!$this->_settingsUpdates) { $this->_settingsUpdates = new SettingsUpdateList($this); } return $this->_settingsUpdates; } protected function getSims(): SimList { if (!$this->_sims) { $this->_sims = new SimList($this); } return $this->_sims; } protected function getSmsCommands(): SmsCommandList { if (!$this->_smsCommands) { $this->_smsCommands = new SmsCommandList($this); } return $this->_smsCommands; } protected function getUsageRecords(): UsageRecordList { if (!$this->_usageRecords) { $this->_usageRecords = new UsageRecordList($this); } return $this->_usageRecords; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkList.php000064400000015242150364341760025521 0ustar00solution = [ 'networkAccessProfileSid' => $networkAccessProfileSid, ]; $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($networkAccessProfileSid) .'/Networks'; } /** * Create the NetworkAccessProfileNetworkInstance * * @param string $network The SID of the Network resource to be added to the Network Access Profile resource. * @return NetworkAccessProfileNetworkInstance Created NetworkAccessProfileNetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $network): NetworkAccessProfileNetworkInstance { $data = Values::of([ 'Network' => $network, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NetworkAccessProfileNetworkInstance( $this->version, $payload, $this->solution['networkAccessProfileSid'] ); } /** * Reads NetworkAccessProfileNetworkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NetworkAccessProfileNetworkInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams NetworkAccessProfileNetworkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NetworkAccessProfileNetworkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NetworkAccessProfileNetworkPage Page of NetworkAccessProfileNetworkInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NetworkAccessProfileNetworkPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NetworkAccessProfileNetworkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NetworkAccessProfileNetworkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NetworkAccessProfileNetworkPage Page of NetworkAccessProfileNetworkInstance */ public function getPage(string $targetUrl): NetworkAccessProfileNetworkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NetworkAccessProfileNetworkPage($this->version, $response, $this->solution); } /** * Constructs a NetworkAccessProfileNetworkContext * * @param string $sid The SID of the Network resource to be removed from the Network Access Profile resource. */ public function getContext( string $sid ): NetworkAccessProfileNetworkContext { return new NetworkAccessProfileNetworkContext( $this->version, $this->solution['networkAccessProfileSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkList]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkInstance.php000064400000010624150364341760026351 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'networkAccessProfileSid' => Values::array_get($payload, 'network_access_profile_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'identifiers' => Values::array_get($payload, 'identifiers'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['networkAccessProfileSid' => $networkAccessProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NetworkAccessProfileNetworkContext Context for this NetworkAccessProfileNetworkInstance */ protected function proxy(): NetworkAccessProfileNetworkContext { if (!$this->context) { $this->context = new NetworkAccessProfileNetworkContext( $this->version, $this->solution['networkAccessProfileSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the NetworkAccessProfileNetworkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the NetworkAccessProfileNetworkInstance * * @return NetworkAccessProfileNetworkInstance Fetched NetworkAccessProfileNetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkAccessProfileNetworkInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkPage.php000064400000003340150364341760025456 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return NetworkAccessProfileNetworkInstance \Twilio\Rest\Supersim\V1\NetworkAccessProfile\NetworkAccessProfileNetworkInstance */ public function buildInstance(array $payload): NetworkAccessProfileNetworkInstance { return new NetworkAccessProfileNetworkInstance($this->version, $payload, $this->solution['networkAccessProfileSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php000064400000005471150364341760026235 0ustar00solution = [ 'networkAccessProfileSid' => $networkAccessProfileSid, 'sid' => $sid, ]; $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($networkAccessProfileSid) .'/Networks/' . \rawurlencode($sid) .''; } /** * Delete the NetworkAccessProfileNetworkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the NetworkAccessProfileNetworkInstance * * @return NetworkAccessProfileNetworkInstance Fetched NetworkAccessProfileNetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkAccessProfileNetworkInstance { $payload = $this->version->fetch('GET', $this->uri); return new NetworkAccessProfileNetworkInstance( $this->version, $payload, $this->solution['networkAccessProfileSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateOptions.php000064400000005326150364341760017444 0ustar00options['sim'] = $sim; $this->options['status'] = $status; } /** * Filter the Settings Updates by a Super SIM's SID or UniqueName. * * @param string $sim Filter the Settings Updates by a Super SIM's SID or UniqueName. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. * * @param string $status Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadSettingsUpdateOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkContext.php000064400000003674150364341760016127 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/Networks/' . \rawurlencode($sid) .''; } /** * Fetch the NetworkInstance * * @return NetworkInstance Fetched NetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkInstance { $payload = $this->version->fetch('GET', $this->uri); return new NetworkInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetPage.php000064400000003006150364341760014752 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return FleetInstance \Twilio\Rest\Supersim\V1\FleetInstance */ public function buildInstance(array $payload): FleetInstance { return new FleetInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.FleetPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.php000064400000022117150364341760016714 0ustar00options['callbackUrl'] = $callbackUrl; $this->options['callbackMethod'] = $callbackMethod; $this->options['generateMatchingId'] = $generateMatchingId; $this->options['eid'] = $eid; } /** * The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. * * @param string $callbackUrl The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. * * @param bool $generateMatchingId When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. * @return $this Fluent Builder */ public function setGenerateMatchingId(bool $generateMatchingId): self { $this->options['generateMatchingId'] = $generateMatchingId; return $this; } /** * Identifier of the eUICC that will claim the eSIM Profile. * * @param string $eid Identifier of the eUICC that will claim the eSIM Profile. * @return $this Fluent Builder */ public function setEid(string $eid): self { $this->options['eid'] = $eid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateEsimProfileOptions ' . $options . ']'; } } class ReadEsimProfileOptions extends Options { /** * @param string $eid List the eSIM Profiles that have been associated with an EId. * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. * @param string $status List the eSIM Profiles that are in a given status. */ public function __construct( string $eid = Values::NONE, string $simSid = Values::NONE, string $status = Values::NONE ) { $this->options['eid'] = $eid; $this->options['simSid'] = $simSid; $this->options['status'] = $status; } /** * List the eSIM Profiles that have been associated with an EId. * * @param string $eid List the eSIM Profiles that have been associated with an EId. * @return $this Fluent Builder */ public function setEid(string $eid): self { $this->options['eid'] = $eid; return $this; } /** * Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. * * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. * @return $this Fluent Builder */ public function setSimSid(string $simSid): self { $this->options['simSid'] = $simSid; return $this; } /** * List the eSIM Profiles that are in a given status. * * @param string $status List the eSIM Profiles that are in a given status. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadEsimProfileOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfilePage.php000064400000003140150364341760020006 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return NetworkAccessProfileInstance \Twilio\Rest\Supersim\V1\NetworkAccessProfileInstance */ public function buildInstance(array $payload): NetworkAccessProfileInstance { return new NetworkAccessProfileInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkAccessProfilePage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SimList.php000064400000014410150364341760014503 0ustar00solution = [ ]; $this->uri = '/Sims'; } /** * Create the SimInstance * * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) of the Super SIM to be added to your Account. * @param string $registrationCode The 10-digit code required to claim the Super SIM for your Account. * @return SimInstance Created SimInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $iccid, string $registrationCode): SimInstance { $data = Values::of([ 'Iccid' => $iccid, 'RegistrationCode' => $registrationCode, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SimInstance( $this->version, $payload ); } /** * Reads SimInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SimPage Page of SimInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SimPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'Fleet' => $options['fleet'], 'Iccid' => $options['iccid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SimPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SimPage Page of SimInstance */ public function getPage(string $targetUrl): SimPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimPage($this->version, $response, $this->solution); } /** * Constructs a SimContext * * @param string $sid The SID of the Sim resource to fetch. */ public function getContext( string $sid ): SimContext { return new SimContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimList]'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfileList.php000064400000014776150364341760016210 0ustar00solution = [ ]; $this->uri = '/ESimProfiles'; } /** * Create the EsimProfileInstance * * @param array|Options $options Optional Arguments * @return EsimProfileInstance Created EsimProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): EsimProfileInstance { $options = new Values($options); $data = Values::of([ 'CallbackUrl' => $options['callbackUrl'], 'CallbackMethod' => $options['callbackMethod'], 'GenerateMatchingId' => Serialize::booleanToString($options['generateMatchingId']), 'Eid' => $options['eid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EsimProfileInstance( $this->version, $payload ); } /** * Reads EsimProfileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EsimProfileInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams EsimProfileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EsimProfileInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EsimProfilePage Page of EsimProfileInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EsimProfilePage { $options = new Values($options); $params = Values::of([ 'Eid' => $options['eid'], 'SimSid' => $options['simSid'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EsimProfilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EsimProfileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EsimProfilePage Page of EsimProfileInstance */ public function getPage(string $targetUrl): EsimProfilePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EsimProfilePage($this->version, $response, $this->solution); } /** * Constructs a EsimProfileContext * * @param string $sid The SID of the eSIM Profile resource to fetch. */ public function getContext( string $sid ): EsimProfileContext { return new EsimProfileContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.EsimProfileList]'; } } sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateInstance.php000064400000005456150364341760017561 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'iccid' => Values::array_get($payload, 'iccid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'status' => Values::array_get($payload, 'status'), 'packages' => Values::array_get($payload, 'packages'), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SettingsUpdateInstance]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php000064400000011112150364341760020554 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($sid) .''; } /** * Fetch the NetworkAccessProfileInstance * * @return NetworkAccessProfileInstance Fetched NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkAccessProfileInstance { $payload = $this->version->fetch('GET', $this->uri); return new NetworkAccessProfileInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the NetworkAccessProfileInstance * * @param array|Options $options Optional Arguments * @return NetworkAccessProfileInstance Updated NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): NetworkAccessProfileInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new NetworkAccessProfileInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the networks */ protected function getNetworks(): NetworkAccessProfileNetworkList { if (!$this->_networks) { $this->_networks = new NetworkAccessProfileNetworkList( $this->version, $this->solution['sid'] ); } return $this->_networks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkAccessProfileContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetInstance.php000064400000012025150364341760015643 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'dataEnabled' => Values::array_get($payload, 'data_enabled'), 'dataLimit' => Values::array_get($payload, 'data_limit'), 'dataMetering' => Values::array_get($payload, 'data_metering'), 'smsCommandsEnabled' => Values::array_get($payload, 'sms_commands_enabled'), 'smsCommandsUrl' => Values::array_get($payload, 'sms_commands_url'), 'smsCommandsMethod' => Values::array_get($payload, 'sms_commands_method'), 'networkAccessProfileSid' => Values::array_get($payload, 'network_access_profile_sid'), 'ipCommandsUrl' => Values::array_get($payload, 'ip_commands_url'), 'ipCommandsMethod' => Values::array_get($payload, 'ip_commands_method'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FleetContext Context for this FleetInstance */ protected function proxy(): FleetContext { if (!$this->context) { $this->context = new FleetContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FleetInstance { return $this->proxy()->fetch(); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FleetInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.FleetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandContext.php000064400000003721150364341760016336 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/IpCommands/' . \rawurlencode($sid) .''; } /** * Fetch the IpCommandInstance * * @return IpCommandInstance Fetched IpCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpCommandInstance { $payload = $this->version->fetch('GET', $this->uri); return new IpCommandInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.IpCommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/UsageRecordPage.php000064400000003052150364341760016117 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return UsageRecordInstance \Twilio\Rest\Supersim\V1\UsageRecordInstance */ public function buildInstance(array $payload): UsageRecordInstance { return new UsageRecordInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.UsageRecordPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SimInstance.php000064400000011432150364341760015335 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'iccid' => Values::array_get($payload, 'iccid'), 'status' => Values::array_get($payload, 'status'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SimContext Context for this SimInstance */ protected function proxy(): SimContext { if (!$this->context) { $this->context = new SimContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SimInstance { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SimInstance { return $this->proxy()->update($options); } /** * Access the billingPeriods */ protected function getBillingPeriods(): BillingPeriodList { return $this->proxy()->billingPeriods; } /** * Access the simIpAddresses */ protected function getSimIpAddresses(): SimIpAddressList { return $this->proxy()->simIpAddresses; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.SimInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkList.php000064400000012761150364341760015413 0ustar00solution = [ ]; $this->uri = '/Networks'; } /** * Reads NetworkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NetworkInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams NetworkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NetworkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NetworkPage Page of NetworkInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NetworkPage { $options = new Values($options); $params = Values::of([ 'IsoCountry' => $options['isoCountry'], 'Mcc' => $options['mcc'], 'Mnc' => $options['mnc'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NetworkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NetworkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NetworkPage Page of NetworkInstance */ public function getPage(string $targetUrl): NetworkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NetworkPage($this->version, $response, $this->solution); } /** * Constructs a NetworkContext * * @param string $sid The SID of the Network resource to fetch. */ public function getContext( string $sid ): NetworkContext { return new NetworkContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkList]'; } } sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateList.php000064400000012361150364341760016721 0ustar00solution = [ ]; $this->uri = '/SettingsUpdates'; } /** * Reads SettingsUpdateInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SettingsUpdateInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SettingsUpdateInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SettingsUpdateInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SettingsUpdatePage Page of SettingsUpdateInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SettingsUpdatePage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SettingsUpdatePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SettingsUpdateInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SettingsUpdatePage Page of SettingsUpdateInstance */ public function getPage(string $targetUrl): SettingsUpdatePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SettingsUpdatePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SettingsUpdateList]'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandOptions.php000064400000017761150364341760016356 0ustar00options['payloadType'] = $payloadType; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackMethod'] = $callbackMethod; } /** * @param string $payloadType * @return $this Fluent Builder */ public function setPayloadType(string $payloadType): self { $this->options['payloadType'] = $payloadType; return $this; } /** * The URL we should call using the `callback_method` after we have sent the IP Command. * * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the IP Command. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateIpCommandOptions ' . $options . ']'; } } class ReadIpCommandOptions extends Options { /** * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ public function __construct( string $sim = Values::NONE, string $simIccid = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ) { $this->options['sim'] = $sim; $this->options['simIccid'] = $simIccid; $this->options['status'] = $status; $this->options['direction'] = $direction; } /** * The SID or unique name of the Sim resource that IP Command was sent to or from. * * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The ICCID of the Sim resource that IP Command was sent to or from. * * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. * @return $this Fluent Builder */ public function setSimIccid(string $simIccid): self { $this->options['simIccid'] = $simIccid; return $this; } /** * The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. * * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadIpCommandOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandPage.php000064400000003036150364341760015565 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return IpCommandInstance \Twilio\Rest\Supersim\V1\IpCommandInstance */ public function buildInstance(array $payload): IpCommandInstance { return new IpCommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.IpCommandPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/UsageRecordList.php000064400000013214150364341760016157 0ustar00solution = [ ]; $this->uri = '/UsageRecords'; } /** * Reads UsageRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsageRecordInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UsageRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UsageRecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UsageRecordPage Page of UsageRecordInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UsageRecordPage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'Fleet' => $options['fleet'], 'Network' => $options['network'], 'IsoCountry' => $options['isoCountry'], 'Group' => $options['group'], 'Granularity' => $options['granularity'], 'StartTime' => Serialize::iso8601DateTime($options['startTime']), 'EndTime' => Serialize::iso8601DateTime($options['endTime']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsageRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UsageRecordPage Page of UsageRecordInstance */ public function getPage(string $targetUrl): UsageRecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.UsageRecordList]'; } } sdk/src/Twilio/Rest/Supersim/V1/SimPage.php000064400000002772150364341760014454 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SimInstance \Twilio\Rest\Supersim\V1\SimInstance */ public function buildInstance(array $payload): SimInstance { return new SimInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandInstance.php000064400000007651150364341760016656 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'payload' => Values::array_get($payload, 'payload'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SmsCommandContext Context for this SmsCommandInstance */ protected function proxy(): SmsCommandContext { if (!$this->context) { $this->context = new SmsCommandContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the SmsCommandInstance * * @return SmsCommandInstance Fetched SmsCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SmsCommandInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.SmsCommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandInstance.php000064400000010500150364341760016447 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'simIccid' => Values::array_get($payload, 'sim_iccid'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'deviceIp' => Values::array_get($payload, 'device_ip'), 'devicePort' => Values::array_get($payload, 'device_port'), 'payloadType' => Values::array_get($payload, 'payload_type'), 'payload' => Values::array_get($payload, 'payload'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpCommandContext Context for this IpCommandInstance */ protected function proxy(): IpCommandContext { if (!$this->context) { $this->context = new IpCommandContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the IpCommandInstance * * @return IpCommandInstance Fetched IpCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpCommandInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.IpCommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfileInstance.php000064400000010742150364341760017026 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'iccid' => Values::array_get($payload, 'iccid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'status' => Values::array_get($payload, 'status'), 'eid' => Values::array_get($payload, 'eid'), 'smdpPlusAddress' => Values::array_get($payload, 'smdp_plus_address'), 'matchingId' => Values::array_get($payload, 'matching_id'), 'activationCode' => Values::array_get($payload, 'activation_code'), 'errorCode' => Values::array_get($payload, 'error_code'), 'errorMessage' => Values::array_get($payload, 'error_message'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EsimProfileContext Context for this EsimProfileInstance */ protected function proxy(): EsimProfileContext { if (!$this->context) { $this->context = new EsimProfileContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the EsimProfileInstance * * @return EsimProfileInstance Fetched EsimProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EsimProfileInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.EsimProfileInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetContext.php000064400000006060150364341760015525 0ustar00solution = [ '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'] ); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FleetInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'NetworkAccessProfile' => $options['networkAccessProfile'], 'IpCommandsUrl' => $options['ipCommandsUrl'], 'IpCommandsMethod' => $options['ipCommandsMethod'], 'SmsCommandsUrl' => $options['smsCommandsUrl'], 'SmsCommandsMethod' => $options['smsCommandsMethod'], 'DataLimit' => $options['dataLimit'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FleetInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.FleetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfilePage.php000064400000003052150364341760016132 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return EsimProfileInstance \Twilio\Rest\Supersim\V1\EsimProfileInstance */ public function buildInstance(array $payload): EsimProfileInstance { return new EsimProfileInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.EsimProfilePage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SimContext.php000064400000011751150364341760015221 0ustar00solution = [ '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'], 'Status' => $options['status'], 'Fleet' => $options['fleet'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackMethod' => $options['callbackMethod'], 'AccountSid' => $options['accountSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SimInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the billingPeriods */ protected function getBillingPeriods(): BillingPeriodList { if (!$this->_billingPeriods) { $this->_billingPeriods = new BillingPeriodList( $this->version, $this->solution['sid'] ); } return $this->_billingPeriods; } /** * Access the simIpAddresses */ protected function getSimIpAddresses(): SimIpAddressList { if (!$this->_simIpAddresses) { $this->_simIpAddresses = new SimIpAddressList( $this->version, $this->solution['sid'] ); } return $this->_simIpAddresses; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.SimContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileOptions.php000064400000011015150364341760020565 0ustar00options['uniqueName'] = $uniqueName; $this->options['networks'] = $networks; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * List of Network SIDs that this Network Access Profile will allow connections to. * * @param string[] $networks List of Network SIDs that this Network Access Profile will allow connections to. * @return $this Fluent Builder */ public function setNetworks(array $networks): self { $this->options['networks'] = $networks; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateNetworkAccessProfileOptions ' . $options . ']'; } } class UpdateNetworkAccessProfileOptions extends Options { /** * @param string $uniqueName The new unique name of the Network Access Profile. */ public function __construct( string $uniqueName = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; } /** * The new unique name of the Network Access Profile. * * @param string $uniqueName The new unique name of the Network Access Profile. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.UpdateNetworkAccessProfileOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandList.php000064400000016107150364341760015627 0ustar00solution = [ ]; $this->uri = '/IpCommands'; } /** * Create the IpCommandInstance * * @param string $sim The `sid` or `unique_name` of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the IP Command to. * @param string $payload The data that will be sent to the device. The payload cannot exceed 1300 bytes. If the PayloadType is set to text, the payload is encoded in UTF-8. If PayloadType is set to binary, the payload is encoded in Base64. * @param int $devicePort The device port to which the IP Command will be sent. * @param array|Options $options Optional Arguments * @return IpCommandInstance Created IpCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $sim, string $payload, int $devicePort, array $options = []): IpCommandInstance { $options = new Values($options); $data = Values::of([ 'Sim' => $sim, 'Payload' => $payload, 'DevicePort' => $devicePort, 'PayloadType' => $options['payloadType'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackMethod' => $options['callbackMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpCommandInstance( $this->version, $payload ); } /** * Reads IpCommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpCommandInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams IpCommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpCommandInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpCommandPage Page of IpCommandInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpCommandPage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'SimIccid' => $options['simIccid'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpCommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpCommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpCommandPage Page of IpCommandInstance */ public function getPage(string $targetUrl): IpCommandPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpCommandPage($this->version, $response, $this->solution); } /** * Constructs a IpCommandContext * * @param string $sid The SID of the IP Command resource to fetch. */ public function getContext( string $sid ): IpCommandContext { return new IpCommandContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.IpCommandList]'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php000064400000003745150364341760016713 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/ESimProfiles/' . \rawurlencode($sid) .''; } /** * Fetch the EsimProfileInstance * * @return EsimProfileInstance Fetched EsimProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EsimProfileInstance { $payload = $this->version->fetch('GET', $this->uri); return new EsimProfileInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.EsimProfileContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetList.php000064400000015571150364341760015023 0ustar00solution = [ ]; $this->uri = '/Fleets'; } /** * Create the FleetInstance * * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * @param array|Options $options Optional Arguments * @return FleetInstance Created FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $networkAccessProfile, array $options = []): FleetInstance { $options = new Values($options); $data = Values::of([ 'NetworkAccessProfile' => $networkAccessProfile, 'UniqueName' => $options['uniqueName'], 'DataEnabled' => Serialize::booleanToString($options['dataEnabled']), 'DataLimit' => $options['dataLimit'], 'IpCommandsUrl' => $options['ipCommandsUrl'], 'IpCommandsMethod' => $options['ipCommandsMethod'], 'SmsCommandsEnabled' => Serialize::booleanToString($options['smsCommandsEnabled']), 'SmsCommandsUrl' => $options['smsCommandsUrl'], 'SmsCommandsMethod' => $options['smsCommandsMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FleetInstance( $this->version, $payload ); } /** * Reads FleetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FleetInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams FleetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FleetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FleetPage Page of FleetInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FleetPage { $options = new Values($options); $params = Values::of([ 'NetworkAccessProfile' => $options['networkAccessProfile'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FleetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FleetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FleetPage Page of FleetInstance */ public function getPage(string $targetUrl): FleetPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FleetPage($this->version, $response, $this->solution); } /** * Constructs a FleetContext * * @param string $sid The SID of the Fleet resource to fetch. */ public function getContext( string $sid ): FleetContext { return new FleetContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.FleetList]'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandList.php000064400000015206150364341760016020 0ustar00solution = [ ]; $this->uri = '/SmsCommands'; } /** * Create the SmsCommandInstance * * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the SMS Command to. * @param string $payload The message body of the SMS Command. * @param array|Options $options Optional Arguments * @return SmsCommandInstance Created SmsCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $sim, string $payload, array $options = []): SmsCommandInstance { $options = new Values($options); $data = Values::of([ 'Sim' => $sim, 'Payload' => $payload, 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SmsCommandInstance( $this->version, $payload ); } /** * Reads SmsCommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SmsCommandInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SmsCommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SmsCommandInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SmsCommandPage Page of SmsCommandInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SmsCommandPage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SmsCommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SmsCommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SmsCommandPage Page of SmsCommandInstance */ public function getPage(string $targetUrl): SmsCommandPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SmsCommandPage($this->version, $response, $this->solution); } /** * Constructs a SmsCommandContext * * @param string $sid The SID of the SMS Command resource to fetch. */ public function getContext( string $sid ): SmsCommandContext { return new SmsCommandContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SmsCommandList]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkOptions.php000064400000007465150364341760016140 0ustar00options['isoCountry'] = $isoCountry; $this->options['mcc'] = $mcc; $this->options['mnc'] = $mnc; } /** * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. * * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. * * @param string $mcc The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. * @return $this Fluent Builder */ public function setMcc(string $mcc): self { $this->options['mcc'] = $mcc; return $this; } /** * The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. * * @param string $mnc The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. * @return $this Fluent Builder */ public function setMnc(string $mnc): self { $this->options['mnc'] = $mnc; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadNetworkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileInstance.php000064400000011046150364341760020702 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NetworkAccessProfileContext Context for this NetworkAccessProfileInstance */ protected function proxy(): NetworkAccessProfileContext { if (!$this->context) { $this->context = new NetworkAccessProfileContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the NetworkAccessProfileInstance * * @return NetworkAccessProfileInstance Fetched NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkAccessProfileInstance { return $this->proxy()->fetch(); } /** * Update the NetworkAccessProfileInstance * * @param array|Options $options Optional Arguments * @return NetworkAccessProfileInstance Updated NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): NetworkAccessProfileInstance { return $this->proxy()->update($options); } /** * Access the networks */ protected function getNetworks(): NetworkAccessProfileNetworkList { return $this->proxy()->networks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkAccessProfileInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandPage.php000064400000003044150364341760015756 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SmsCommandInstance \Twilio\Rest\Supersim\V1\SmsCommandInstance */ public function buildInstance(array $payload): SmsCommandInstance { return new SmsCommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SmsCommandPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdatePage.php000064400000003074150364341760016663 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SettingsUpdateInstance \Twilio\Rest\Supersim\V1\SettingsUpdateInstance */ public function buildInstance(array $payload): SettingsUpdateInstance { return new SettingsUpdateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SettingsUpdatePage]'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetOptions.php000064400000053170150364341760015540 0ustar00options['uniqueName'] = $uniqueName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['ipCommandsUrl'] = $ipCommandsUrl; $this->options['ipCommandsMethod'] = $ipCommandsMethod; $this->options['smsCommandsEnabled'] = $smsCommandsEnabled; $this->options['smsCommandsUrl'] = $smsCommandsUrl; $this->options['smsCommandsMethod'] = $smsCommandsMethod; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. * * @param bool $dataEnabled Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. * @return $this Fluent Builder */ public function setDataEnabled(bool $dataEnabled): self { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @return $this Fluent Builder */ public function setIpCommandsUrl(string $ipCommandsUrl): self { $this->options['ipCommandsUrl'] = $ipCommandsUrl; return $this; } /** * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return $this Fluent Builder */ public function setIpCommandsMethod(string $ipCommandsMethod): self { $this->options['ipCommandsMethod'] = $ipCommandsMethod; return $this; } /** * Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. * * @param bool $smsCommandsEnabled Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. * @return $this Fluent Builder */ public function setSmsCommandsEnabled(bool $smsCommandsEnabled): self { $this->options['smsCommandsEnabled'] = $smsCommandsEnabled; return $this; } /** * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @return $this Fluent Builder */ public function setSmsCommandsUrl(string $smsCommandsUrl): self { $this->options['smsCommandsUrl'] = $smsCommandsUrl; return $this; } /** * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return $this Fluent Builder */ public function setSmsCommandsMethod(string $smsCommandsMethod): self { $this->options['smsCommandsMethod'] = $smsCommandsMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateFleetOptions ' . $options . ']'; } } class ReadFleetOptions extends Options { /** * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. */ public function __construct( string $networkAccessProfile = Values::NONE ) { $this->options['networkAccessProfile'] = $networkAccessProfile; } /** * The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. * * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. * @return $this Fluent Builder */ public function setNetworkAccessProfile(string $networkAccessProfile): self { $this->options['networkAccessProfile'] = $networkAccessProfile; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadFleetOptions ' . $options . ']'; } } class UpdateFleetOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). */ public function __construct( string $uniqueName = Values::NONE, string $networkAccessProfile = Values::NONE, string $ipCommandsUrl = Values::NONE, string $ipCommandsMethod = Values::NONE, string $smsCommandsUrl = Values::NONE, string $smsCommandsMethod = Values::NONE, int $dataLimit = Values::INT_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['networkAccessProfile'] = $networkAccessProfile; $this->options['ipCommandsUrl'] = $ipCommandsUrl; $this->options['ipCommandsMethod'] = $ipCommandsMethod; $this->options['smsCommandsUrl'] = $smsCommandsUrl; $this->options['smsCommandsMethod'] = $smsCommandsMethod; $this->options['dataLimit'] = $dataLimit; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * @return $this Fluent Builder */ public function setNetworkAccessProfile(string $networkAccessProfile): self { $this->options['networkAccessProfile'] = $networkAccessProfile; return $this; } /** * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @return $this Fluent Builder */ public function setIpCommandsUrl(string $ipCommandsUrl): self { $this->options['ipCommandsUrl'] = $ipCommandsUrl; return $this; } /** * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return $this Fluent Builder */ public function setIpCommandsMethod(string $ipCommandsMethod): self { $this->options['ipCommandsMethod'] = $ipCommandsMethod; return $this; } /** * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @return $this Fluent Builder */ public function setSmsCommandsUrl(string $smsCommandsUrl): self { $this->options['smsCommandsUrl'] = $smsCommandsUrl; return $this; } /** * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return $this Fluent Builder */ public function setSmsCommandsMethod(string $smsCommandsMethod): self { $this->options['smsCommandsMethod'] = $smsCommandsMethod; return $this; } /** * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.UpdateFleetOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/UsageRecordInstance.php000064400000006053150364341760017013 0ustar00properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'networkSid' => Values::array_get($payload, 'network_sid'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'period' => Values::array_get($payload, 'period'), 'dataUpload' => Values::array_get($payload, 'data_upload'), 'dataDownload' => Values::array_get($payload, 'data_download'), 'dataTotal' => Values::array_get($payload, 'data_total'), 'dataTotalBilled' => Values::array_get($payload, 'data_total_billed'), 'billedUnit' => Values::array_get($payload, 'billed_unit'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.UsageRecordInstance]'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandOptions.php000064400000015610150364341760016537 0ustar00options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we should call using the `callback_method` after we have sent the command. * * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the command. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateSmsCommandOptions ' . $options . ']'; } } class ReadSmsCommandOptions extends Options { /** * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ public function __construct( string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ) { $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; } /** * The SID or unique name of the Sim resource that SMS Command was sent to or from. * * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. * * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadSmsCommandOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php000064400000003733150364341760016533 0ustar00solution = [ 'sid' => $sid, ]; $this->uri = '/SmsCommands/' . \rawurlencode($sid) .''; } /** * Fetch the SmsCommandInstance * * @return SmsCommandInstance Fetched SmsCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SmsCommandInstance { $payload = $this->version->fetch('GET', $this->uri); return new SmsCommandInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.SmsCommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodList.php000064400000012062150364341760017227 0ustar00solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/BillingPeriods'; } /** * Reads BillingPeriodInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BillingPeriodInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BillingPeriodInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BillingPeriodInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BillingPeriodPage Page of BillingPeriodInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BillingPeriodPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BillingPeriodPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BillingPeriodInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BillingPeriodPage Page of BillingPeriodInstance */ public function getPage(string $targetUrl): BillingPeriodPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BillingPeriodPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.BillingPeriodList]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressPage.php000064400000003123150364341760016772 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return SimIpAddressInstance \Twilio\Rest\Supersim\V1\Sim\SimIpAddressInstance */ public function buildInstance(array $payload): SimIpAddressInstance { return new SimIpAddressInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimIpAddressPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodInstance.php000064400000005717150364341760020071 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'periodType' => Values::array_get($payload, 'period_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.BillingPeriodInstance]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodPage.php000064400000003131150364341760017165 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return BillingPeriodInstance \Twilio\Rest\Supersim\V1\Sim\BillingPeriodInstance */ public function buildInstance(array $payload): BillingPeriodInstance { return new BillingPeriodInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.BillingPeriodPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressInstance.php000064400000004363150364341760017671 0ustar00properties = [ 'ipAddress' => Values::array_get($payload, 'ip_address'), 'ipAddressVersion' => Values::array_get($payload, 'ip_address_version'), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimIpAddressInstance]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressList.php000064400000012034150364341760017032 0ustar00solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/IpAddresses'; } /** * Reads SimIpAddressInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimIpAddressInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SimIpAddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SimIpAddressInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SimIpAddressPage Page of SimIpAddressInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SimIpAddressPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SimIpAddressPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimIpAddressInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SimIpAddressPage Page of SimIpAddressInstance */ public function getPage(string $targetUrl): SimIpAddressPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimIpAddressPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimIpAddressList]'; } } sdk/src/Twilio/Rest/Supersim/V1/UsageRecordOptions.php000064400000022742150364341760016705 0ustar00options['sim'] = $sim; $this->options['fleet'] = $fleet; $this->options['network'] = $network; $this->options['isoCountry'] = $isoCountry; $this->options['group'] = $group; $this->options['granularity'] = $granularity; $this->options['startTime'] = $startTime; $this->options['endTime'] = $endTime; } /** * SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. * * @param string $sim SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. * * @param string $fleet SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. * @return $this Fluent Builder */ public function setFleet(string $fleet): self { $this->options['fleet'] = $fleet; return $this; } /** * SID of a Network resource. Only show UsageRecords representing usage on this network. * * @param string $network SID of a Network resource. Only show UsageRecords representing usage on this network. * @return $this Fluent Builder */ public function setNetwork(string $network): self { $this->options['network'] = $network; return $this; } /** * Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. * * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. * * @param string $group Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. * @return $this Fluent Builder */ public function setGroup(string $group): self { $this->options['group'] = $group; return $this; } /** * Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. * * @param string $granularity Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. * @return $this Fluent Builder */ public function setGranularity(string $granularity): self { $this->options['granularity'] = $granularity; return $this; } /** * Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. * * @param \DateTime $startTime Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. * @return $this Fluent Builder */ public function setStartTime(\DateTime $startTime): self { $this->options['startTime'] = $startTime; return $this; } /** * Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. * * @param \DateTime $endTime Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. * @return $this Fluent Builder */ public function setEndTime(\DateTime $endTime): self { $this->options['endTime'] = $endTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadUsageRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileList.php000064400000014301150364341760020046 0ustar00solution = [ ]; $this->uri = '/NetworkAccessProfiles'; } /** * Create the NetworkAccessProfileInstance * * @param array|Options $options Optional Arguments * @return NetworkAccessProfileInstance Created NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): NetworkAccessProfileInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Networks' => Serialize::map($options['networks'], function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NetworkAccessProfileInstance( $this->version, $payload ); } /** * Reads NetworkAccessProfileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NetworkAccessProfileInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams NetworkAccessProfileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NetworkAccessProfileInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NetworkAccessProfilePage Page of NetworkAccessProfileInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NetworkAccessProfilePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NetworkAccessProfilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NetworkAccessProfileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NetworkAccessProfilePage Page of NetworkAccessProfileInstance */ public function getPage(string $targetUrl): NetworkAccessProfilePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NetworkAccessProfilePage($this->version, $response, $this->solution); } /** * Constructs a NetworkAccessProfileContext * * @param string $sid The SID of the Network Access Profile resource to fetch. */ public function getContext( string $sid ): NetworkAccessProfileContext { return new NetworkAccessProfileContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkAccessProfileList]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkInstance.php000064400000006670150364341760016246 0ustar00properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'url' => Values::array_get($payload, 'url'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'identifiers' => Values::array_get($payload, 'identifiers'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NetworkContext Context for this NetworkInstance */ protected function proxy(): NetworkContext { if (!$this->context) { $this->context = new NetworkContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the NetworkInstance * * @return NetworkInstance Fetched NetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SimOptions.php000064400000023513150364341760015227 0ustar00options['status'] = $status; $this->options['fleet'] = $fleet; $this->options['iccid'] = $iccid; } /** * The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. * * @param string $status The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The SID or unique name of the Fleet to which a list of Sims are assigned. * * @param string $fleet The SID or unique name of the Fleet to which a list of Sims are assigned. * @return $this Fluent Builder */ public function setFleet(string $fleet): self { $this->options['fleet'] = $fleet; return $this; } /** * The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. * * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. * @return $this Fluent Builder */ public function setIccid(string $iccid): self { $this->options['iccid'] = $iccid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadSimOptions ' . $options . ']'; } } class UpdateSimOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $status * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. */ public function __construct( string $uniqueName = Values::NONE, string $status = Values::NONE, string $fleet = Values::NONE, string $callbackUrl = Values::NONE, string $callbackMethod = Values::NONE, string $accountSid = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['status'] = $status; $this->options['fleet'] = $fleet; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackMethod'] = $callbackMethod; $this->options['accountSid'] = $accountSid; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The SID or unique name of the Fleet to which the SIM resource should be assigned. * * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. * @return $this Fluent Builder */ public function setFleet(string $fleet): self { $this->options['fleet'] = $fleet; return $this; } /** * The URL we should call using the `callback_method` after an asynchronous update has finished. * * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. * * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.UpdateSimOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkPage.php000064400000003022150364341760015342 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return NetworkInstance \Twilio\Rest\Supersim\V1\NetworkInstance */ public function buildInstance(array $payload): NetworkInstance { return new NetworkInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkPage]'; } } sdk/src/Twilio/Rest/Autopilot.php000064400000002014150364341760012777 0ustar00assistants instead. */ protected function getAssistants(): \Twilio\Rest\Autopilot\V1\AssistantList { echo "assistants is deprecated. Use v1->assistants instead."; return $this->v1->assistants; } /** * @deprecated Use v1->assistants(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextAssistants(string $sid): \Twilio\Rest\Autopilot\V1\AssistantContext { echo "assistants(\$sid) is deprecated. Use v1->assistants(\$sid) instead."; return $this->v1->assistants($sid); } /** * @deprecated Use v1->restoreAssistant instead */ protected function getRestoreAssistant(): \Twilio\Rest\Autopilot\V1\RestoreAssistantList { echo "restoreAssistant is deprecated. Use v1->restoreAssistant instead."; return $this->v1->restoreAssistant; } }sdk/src/Twilio/Rest/Messaging.php000064400000011205150364341770012737 0ustar00brandRegistrations instead."; return $this->v1->brandRegistrations; } /** * @deprecated * @param string $sid The SID that identifies the resource to fetch */ protected function contextBrandRegistrations(string $sid): \Twilio\Rest\Messaging\V1\BrandRegistrationContext { echo "brandRegistrations(\$sid) is deprecated. Use v1->brandRegistrations(\$sid) instead."; return $this->v1->brandRegistrations($sid); } /** * @deprecated */ protected function getDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsList { echo "deactivations is deprecated. Use v1->deactivations instead."; return $this->v1->deactivations; } /** * @deprecated Use v1->deactivations() instead. */ protected function contextDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsContext { echo "deactivations() is deprecated. Use v1->deactivations() instead."; return $this->v1->deactivations(); } /** * @deprecated Use v1->domainCerts instead. */ protected function getDomainCerts(): \Twilio\Rest\Messaging\V1\DomainCertsList { echo "domainCerts is deprecated. Use v1->domainCerts instead."; return $this->v1->domainCerts; } /** * @deprecated Use v1->domainCerts(\$domainSid) instead. * @param string $domainSid Unique string used to identify the domain that this * certificate should be associated with. */ protected function contextDomainCerts(string $domainSid): \Twilio\Rest\Messaging\V1\DomainCertsContext { echo "domainCerts(\$domainSid) is deprecated. Use v1->domainCerts(\$domainSid) instead."; return $this->v1->domainCerts($domainSid); } /** * @deprecated Use v1->domainConfig instead. */ protected function getDomainConfig(): \Twilio\Rest\Messaging\V1\DomainConfigList { echo "domainConfig is deprecated. Use v1->domainConfig instead."; return $this->v1->domainConfig; } /** * @deprecated Use v1->domainConfig(\$domainSid) instead. * @param string $domainSid Unique string used to identify the domain that this * config should be associated with. */ protected function contextDomainConfig(string $domainSid): \Twilio\Rest\Messaging\V1\DomainConfigContext { echo "domainConfig(\$domainSid) is deprecated. Use v1->domainConfig(\$domainSid) instead."; return $this->v1->domainConfig($domainSid); } /** * @deprecated Use v1->externalCampaign instead. */ protected function getExternalCampaign(): \Twilio\Rest\Messaging\V1\ExternalCampaignList { echo "externalCampaign is deprecated. Use v1->externalCampaign instead."; return $this->v1->externalCampaign; } /** * @deprecated Use v1->services instead. */ protected function getServices(): \Twilio\Rest\Messaging\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Messaging\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } /** * @deprecated Use v1->tollfreeVerifications instead. */ protected function getTollfreeVerifications(): \Twilio\Rest\Messaging\V1\TollfreeVerificationList { echo "tollfreeVerifications is deprecated. Use v1->tollfreeVerifications instead."; return $this->v1->tollfreeVerifications; } /** * @deprecated Use v1->tollfreeVerifications(\$sid) instead. * @param string $sid Tollfree Verification Sid */ protected function contextTollfreeVerifications(string $sid): \Twilio\Rest\Messaging\V1\TollfreeVerificationContext { echo "tollfreeVerifications(\$sid) is deprecated. Use v1->tollfreeVerifications(\$sid) instead."; return $this->v1->tollfreeVerifications($sid); } /** * @deprecated Use v1->usecases instead. */ protected function getUsecases(): \Twilio\Rest\Messaging\V1\UsecaseList { echo "usecases is deprecated. Use v1->usecases instead."; return $this->v1->usecases; } }sdk/src/Twilio/Rest/Chat.php000064400000004031150364341770011700 0ustar00credentials instead. */ protected function getCredentials(): \Twilio\Rest\Chat\V2\CredentialList { echo "credentials is deprecated. Use v2->credentials instead."; return $this->v2->credentials; } /** * @deprecated Use v2->credentials(\$sid) instead. * @param string $sid The SID of the Credential resource to fetch */ protected function contextCredentials(string $sid): \Twilio\Rest\Chat\V2\CredentialContext { echo "credentials(\$sid) is deprecated. Use v2->credentials(\$sid) instead."; return $this->v2->credentials($sid); } /** * @deprecated Use v2->services instead. */ protected function getServices(): \Twilio\Rest\Chat\V2\ServiceList { echo "services is deprecated. Use v2->services instead."; return $this->v2->services; } /** * @deprecated Use v2->services(\$sid) instead. * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Chat\V2\ServiceContext { echo "services(\$sid) is deprecated. Use v2->services(\$sid) instead."; return $this->v2->services($sid); } /** * @deprecated Use v3->channels instead. */ protected function getChannels(): \Twilio\Rest\Chat\V3\ChannelList { echo "channels is deprecated. Use v3->channels instead."; return $this->v3->channels; } /** * @deprecated Use v3->channels(\$serviceSid, \$sid) instead. * @param string $serviceSid Service Sid. * @param string $sid A string that uniquely identifies this Channel. */ protected function contextChannels(string $serviceSid, string $sid): \Twilio\Rest\Chat\V3\ChannelContext { echo "channels(\$serviceSid, \$sid) is deprecated. Use v3->channels(\$serviceSid, \$sid) instead."; return $this->v3->channels($serviceSid, $sid); } }sdk/src/Twilio/Rest/Lookups/V1.php000064400000005163150364341770012752 0ustar00version = 'v1'; } protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this); } return $this->_phoneNumbers; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V1]'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberPage.php000064400000003046150364341770015770 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return PhoneNumberInstance \Twilio\Rest\Lookups\V2\PhoneNumberInstance */ public function buildInstance(array $payload): PhoneNumberInstance { return new PhoneNumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V2.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberInstance.php000064400000012013150364341770016652 0ustar00properties = [ 'callingCountryCode' => Values::array_get($payload, 'calling_country_code'), 'countryCode' => Values::array_get($payload, 'country_code'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'nationalFormat' => Values::array_get($payload, 'national_format'), 'valid' => Values::array_get($payload, 'valid'), 'validationErrors' => Values::array_get($payload, 'validation_errors'), 'callerName' => Values::array_get($payload, 'caller_name'), 'simSwap' => Values::array_get($payload, 'sim_swap'), 'callForwarding' => Values::array_get($payload, 'call_forwarding'), 'liveActivity' => Values::array_get($payload, 'live_activity'), 'lineTypeIntelligence' => Values::array_get($payload, 'line_type_intelligence'), 'identityMatch' => Values::array_get($payload, 'identity_match'), 'reassignedNumber' => Values::array_get($payload, 'reassigned_number'), 'smsPumpingRisk' => Values::array_get($payload, 'sms_pumping_risk'), 'phoneNumberQualityScore' => Values::array_get($payload, 'phone_number_quality_score'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Fetch the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PhoneNumberInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php000064400000006220150364341770016535 0ustar00solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) .''; } /** * Fetch the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PhoneNumberInstance { $options = new Values($options); $params = Values::of([ 'Fields' => $options['fields'], 'CountryCode' => $options['countryCode'], 'FirstName' => $options['firstName'], 'LastName' => $options['lastName'], 'AddressLine1' => $options['addressLine1'], 'AddressLine2' => $options['addressLine2'], 'City' => $options['city'], 'State' => $options['state'], 'PostalCode' => $options['postalCode'], 'AddressCountryCode' => $options['addressCountryCode'], 'NationalId' => $options['nationalId'], 'DateOfBirth' => $options['dateOfBirth'], 'LastVerifiedDate' => $options['lastVerifiedDate'], ]); $payload = $this->version->fetch('GET', $this->uri, $params); return new PhoneNumberInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V2.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberList.php000064400000003043150364341770016024 0ustar00solution = [ ]; } /** * Constructs a PhoneNumberContext * * @param string $phoneNumber The phone number to lookup in E.164 or national format. Default country code is +1 (North America). */ public function getContext( string $phoneNumber ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V2.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.php000064400000034250150364341770016550 0ustar00options['fields'] = $fields; $this->options['countryCode'] = $countryCode; $this->options['firstName'] = $firstName; $this->options['lastName'] = $lastName; $this->options['addressLine1'] = $addressLine1; $this->options['addressLine2'] = $addressLine2; $this->options['city'] = $city; $this->options['state'] = $state; $this->options['postalCode'] = $postalCode; $this->options['addressCountryCode'] = $addressCountryCode; $this->options['nationalId'] = $nationalId; $this->options['dateOfBirth'] = $dateOfBirth; $this->options['lastVerifiedDate'] = $lastVerifiedDate; } /** * A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. * * @param string $fields A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. * @return $this Fluent Builder */ public function setFields(string $fields): self { $this->options['fields'] = $fields; return $this; } /** * The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. * * @param string $countryCode The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. * @return $this Fluent Builder */ public function setCountryCode(string $countryCode): self { $this->options['countryCode'] = $countryCode; return $this; } /** * User’s first name. This query parameter is only used (optionally) for identity_match package requests. * * @param string $firstName User’s first name. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setFirstName(string $firstName): self { $this->options['firstName'] = $firstName; return $this; } /** * User’s last name. This query parameter is only used (optionally) for identity_match package requests. * * @param string $lastName User’s last name. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setLastName(string $lastName): self { $this->options['lastName'] = $lastName; return $this; } /** * User’s first address line. This query parameter is only used (optionally) for identity_match package requests. * * @param string $addressLine1 User’s first address line. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setAddressLine1(string $addressLine1): self { $this->options['addressLine1'] = $addressLine1; return $this; } /** * User’s second address line. This query parameter is only used (optionally) for identity_match package requests. * * @param string $addressLine2 User’s second address line. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setAddressLine2(string $addressLine2): self { $this->options['addressLine2'] = $addressLine2; return $this; } /** * User’s city. This query parameter is only used (optionally) for identity_match package requests. * * @param string $city User’s city. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setCity(string $city): self { $this->options['city'] = $city; return $this; } /** * User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. * * @param string $state User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. * * @param string $postalCode User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setPostalCode(string $postalCode): self { $this->options['postalCode'] = $postalCode; return $this; } /** * User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. * * @param string $addressCountryCode User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setAddressCountryCode(string $addressCountryCode): self { $this->options['addressCountryCode'] = $addressCountryCode; return $this; } /** * User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. * * @param string $nationalId User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setNationalId(string $nationalId): self { $this->options['nationalId'] = $nationalId; return $this; } /** * User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. * * @param string $dateOfBirth User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setDateOfBirth(string $dateOfBirth): self { $this->options['dateOfBirth'] = $dateOfBirth; return $this; } /** * The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. * * @param string $lastVerifiedDate The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. * @return $this Fluent Builder */ public function setLastVerifiedDate(string $lastVerifiedDate): self { $this->options['lastVerifiedDate'] = $lastVerifiedDate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Lookups.V2.FetchPhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Lookups/V2.php000064400000005163150364341770012753 0ustar00version = 'v2'; } protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this); } return $this->_phoneNumbers; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V2]'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberPage.php000064400000003046150364341770015767 0ustar00solution = $solution; } /** * @param array $payload Payload response from the API * @return PhoneNumberInstance \Twilio\Rest\Lookups\V1\PhoneNumberInstance */ public function buildInstance(array $payload): PhoneNumberInstance { return new PhoneNumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php000064400000007726150364341770016670 0ustar00properties = [ 'callerName' => Values::array_get($payload, 'caller_name'), 'countryCode' => Values::array_get($payload, 'country_code'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'nationalFormat' => Values::array_get($payload, 'national_format'), 'carrier' => Values::array_get($payload, 'carrier'), 'addOns' => Values::array_get($payload, 'add_ons'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Fetch the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PhoneNumberInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php000064400000005366150364341770016546 0ustar00solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) .''; } /** * Fetch the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PhoneNumberInstance { $options = new Values($options); $params = Values::of([ 'CountryCode' => $options['countryCode'], 'Type' => Serialize::map($options['type'], function ($e) { return $e; }), 'AddOns' => Serialize::map($options['addOns'], function ($e) { return $e; }), ]); $params = \array_merge($params, Serialize::prefixedCollapsibleMap($options['addOnsData'], 'AddOns')); $payload = $this->version->fetch('GET', $this->uri, $params); return new PhoneNumberInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberList.php000064400000003147150364341770016030 0ustar00solution = [ ]; } /** * Constructs a PhoneNumberContext * * @param string $phoneNumber The phone number to lookup in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. */ public function getContext( string $phoneNumber ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php000064400000016017150364341770016550 0ustar00options['countryCode'] = $countryCode; $this->options['type'] = $type; $this->options['addOns'] = $addOns; $this->options['addOnsData'] = $addOnsData; } /** * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. * * @param string $countryCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. * @return $this Fluent Builder */ public function setCountryCode(string $countryCode): self { $this->options['countryCode'] = $countryCode; return $this; } /** * The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. * * @param string[] $type The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). * * @param string[] $addOns The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). * @return $this Fluent Builder */ public function setAddOns(array $addOns): self { $this->options['addOns'] = $addOns; return $this; } /** * Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. * * @param string $addOnsData Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. * @return $this Fluent Builder */ public function setAddOnsData(string $addOnsData): self { $this->options['addOnsData'] = $addOnsData; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Lookups.V1.FetchPhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Base/PhoneNumberCapabilities.php000064400000003272150364341770015520 0ustar00mms = Values::array_get($capabilities, 'mms', "false"); $this->sms = Values::array_get($capabilities, 'sms', "false"); $this->voice = Values::array_get($capabilities, 'voice', "false"); $this->fax = Values::array_get($capabilities, 'fax', "false"); } /** * Access the mms */ public function getMms(): bool { return $this->mms; } /** * Access the sms */ public function getSms(): bool { return $this->sms; } /** * Access the voice */ public function getVoice(): bool { return $this->voice; } /** * Access the fax */ public function getFax(): bool { return $this->fax; } public function __get(string $name) { if (\property_exists($this, $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } public function __toString(): string { return "[Twilio.Base.PhoneNumberCapabilities " . "( mms: " . json_encode($this->mms) . ", sms: " . json_encode($this->sms) . ", voice: " . json_encode($this->voice) . ", fax: " . json_encode($this->fax) . " )]"; } } sdk/src/Twilio/Base/BaseClient.php000064400000026253150364341770013001 0ustar00environment = $environment ?: \getenv(); $this->username = $this->getArg($username, self::ENV_ACCOUNT_SID); $this->password = $this->getArg($password, self::ENV_AUTH_TOKEN); $this->region = $this->getArg($region, self::ENV_REGION); $this->edge = $this->getArg(null, self::ENV_EDGE); $this->logLevel = $this->getArg(null, self::ENV_LOG); $this->userAgentExtensions = $userAgentExtensions ?: []; if (!$this->username || !$this->password) { throw new ConfigurationException('Credentials are required to create a Client'); } $this->accountSid = $accountSid ?: $this->username; if ($httpClient) { $this->httpClient = $httpClient; } else { $this->httpClient = new CurlClient(); } } /** * Determines argument value accounting for environment variables. * * @param string $arg The constructor argument * @param string $envVar The environment variable name * @return ?string Argument value */ public function getArg(?string $arg, string $envVar): ?string { if ($arg) { return $arg; } if (\array_key_exists($envVar, $this->environment)) { return $this->environment[$envVar]; } return null; } /** * Makes a request to the Twilio API using the configured http client * Authentication information is automatically added if none is provided * * @param string $method HTTP Method * @param string $uri Fully qualified url * @param string[] $params Query string parameters * @param string[] $data POST body data * @param string[] $headers HTTP Headers * @param string $username User for Authentication * @param string $password Password for Authentication * @param int $timeout Timeout in seconds * @return \Twilio\Http\Response Response from the Twilio API */ public function request( string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $username = null, string $password = null, int $timeout = null ): \Twilio\Http\Response{ $username = $username ?: $this->username; $password = $password ?: $this->password; $logLevel = (getenv('DEBUG_HTTP_TRAFFIC') === 'true' ? 'debug' : $this->getLogLevel()); $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() . ' (' . php_uname("s") . ' ' . php_uname("m") . ')' . ' PHP/' . PHP_VERSION; $headers['Accept-Charset'] = 'utf-8'; if ($this->userAgentExtensions) { $headers['User-Agent'] .= ' ' . implode(' ', $this->userAgentExtensions); } if (!\array_key_exists('Accept', $headers)) { $headers['Accept'] = 'application/json'; } $uri = $this->buildUri($uri); if ($logLevel === 'debug') { error_log('-- BEGIN Twilio API Request --'); error_log('Request Method: ' . $method); $u = parse_url($uri); if (isset($u['path'])) { error_log('Request URL: ' . $u['path']); } if (isset($u['query']) && strlen($u['query']) > 0) { error_log('Query Params: ' . $u['query']); } error_log('Request Headers: '); foreach ($headers as $key => $value) { if (strpos(strtolower($key), 'authorization') === false) { error_log("$key: $value"); } } error_log('-- END Twilio API Request --'); } $response = $this->getHttpClient()->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($logLevel === 'debug') { error_log('Status Code: ' . $response->getStatusCode()); error_log('Response Headers:'); $responseHeaders = $response->getHeaders(); foreach ($responseHeaders as $key => $value) { error_log("$key: $value"); } } return $response; } /** * Build the final request uri * * @param string $uri The original request uri * @return string Request uri */ public function buildUri(string $uri): string { if ($this->region == null && $this->edge == null) { return $uri; } $parsedUrl = \parse_url($uri); $pieces = \explode('.', $parsedUrl['host']); $product = $pieces[0]; $domain = \implode('.', \array_slice($pieces, -2)); $newEdge = $this->edge; $newRegion = $this->region; if (count($pieces) == 4) { // product.region.twilio.com $newRegion = $newRegion ?: $pieces[1]; } elseif (count($pieces) == 5) { // product.edge.region.twilio.com $newEdge = $newEdge ?: $pieces[1]; $newRegion = $newRegion ?: $pieces[2]; } if ($newEdge != null && $newRegion == null) { $newRegion = self::DEFAULT_REGION; } $parsedUrl['host'] = \implode('.', \array_filter([$product, $newEdge, $newRegion, $domain])); return RequestValidator::unparse_url($parsedUrl); } /** * Magic getter to lazy load domains * * @param string $name Domain to return * @return \Twilio\Domain The requested domain * @throws TwilioException For unknown domains */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown domain ' . $name); } /** * Magic call to lazy load contexts * * @param string $name Context to return * @param mixed[] $arguments Context to return * @return \Twilio\InstanceContext The requested context * @throws TwilioException For unknown contexts */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Client ' . $this->getAccountSid() . ']'; } /** * Validates connection to new SSL certificate endpoint * * @param CurlClient $client * @throws TwilioException if request fails */ public function validateSslCertificate(CurlClient $client): void { $response = $client->request('GET', 'https://tls-test.twilio.com:443'); if ($response->getStatusCode() < 200 || $response->getStatusCode() > 300) { throw new TwilioException('Failed to validate SSL certificate'); } } /** * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the * authenticating account */ public function getAccount(): \Twilio\Rest\Api\V2010\AccountContext { return $this->api->v2010->account; } /** * Retrieve the Username * * @return string Current Username */ public function getUsername(): string { return $this->username; } /** * Retrieve the Password * * @return string Current Password */ public function getPassword(): string { return $this->password; } /** * Retrieve the AccountSid * * @return string Current AccountSid */ public function getAccountSid(): string { return $this->accountSid; } /** * Retrieve the Region * * @return string Current Region */ public function getRegion(): string { return $this->region; } /** * Retrieve the Edge * * @return string Current Edge */ public function getEdge(): string { return $this->edge; } /** * Set Edge * * @param string $uri Edge to use, unsets the Edge when called with no arguments */ public function setEdge(string $edge = null): void { $this->edge = $this->getArg($edge, self::ENV_EDGE); } /** * Retrieve the HttpClient * * @return HttpClient Current HttpClient */ public function getHttpClient(): HttpClient { return $this->httpClient; } /** * Set the HttpClient * * @param HttpClient $httpClient HttpClient to use */ public function setHttpClient(HttpClient $httpClient): void { $this->httpClient = $httpClient; } /** * Retrieve the log level * * @return ?string Current log level */ public function getLogLevel(): ?string { return $this->logLevel; } /** * Set log level to debug * * @param string $logLevel log level to use */ public function setLogLevel(string $logLevel = null): void { $this->logLevel = $this->getArg($logLevel, self::ENV_LOG); } } sdk/src/Twilio/Http/Response.php000064400000001520150364341770012621 0ustar00statusCode = $statusCode; $this->content = $content; $this->headers = $headers; } /** * @return mixed */ public function getContent() { return \json_decode($this->content, true); } public function getStatusCode(): int { return $this->statusCode; } public function getHeaders(): array { return $this->headers; } public function ok(): bool { return $this->getStatusCode() < 400; } public function __toString(): string { return '[Response] HTTP ' . $this->getStatusCode() . ' ' . $this->content; } } sdk/src/Twilio/Http/File.php000064400000001736150364341770011713 0ustar00fileName = $fileName; $this->contents = $contents; $this->contentType = $contentType; } /** * @return resource|string|mixed|null */ public function getContents() { return $this->contents; } public function getFileName(): string { return $this->fileName; } public function getContentType(): ?string { return $this->contentType; } } sdk/src/Twilio/Http/CurlClient.php000064400000020213150364341770013067 0ustar00curlOptions = $options; } public function request(string $method, string $url, array $params = [], array $data = [], array $headers = [], string $user = null, string $password = null, int $timeout = null): Response { $options = $this->options($method, $url, $params, $data, $headers, $user, $password, $timeout); $this->lastRequest = $options; $this->lastResponse = null; try { if (!$curl = \curl_init()) { throw new EnvironmentException('Unable to initialize cURL'); } if (!\curl_setopt_array($curl, $options)) { throw new EnvironmentException(\curl_error($curl)); } if (!$response = \curl_exec($curl)) { throw new EnvironmentException(\curl_error($curl)); } $parts = \explode("\r\n\r\n", $response, 3); list($head, $body) = ( \preg_match('/\AHTTP\/1.\d 100 Continue\Z/', $parts[0]) || \preg_match('/\AHTTP\/1.\d 200 Connection established\Z/', $parts[0]) || \preg_match('/\AHTTP\/1.\d 200 Tunnel established\Z/', $parts[0]) ) ? array($parts[1], $parts[2]) : array($parts[0], $parts[1]); $statusCode = \curl_getinfo($curl, CURLINFO_HTTP_CODE); $responseHeaders = []; $headerLines = \explode("\r\n", $head); \array_shift($headerLines); foreach ($headerLines as $line) { list($key, $value) = \explode(':', $line, 2); $responseHeaders[$key] = $value; } \curl_close($curl); if (isset($options[CURLOPT_INFILE]) && \is_resource($options[CURLOPT_INFILE])) { \fclose($options[CURLOPT_INFILE]); } $this->lastResponse = new Response($statusCode, $body, $responseHeaders); return $this->lastResponse; } catch (\ErrorException $e) { if (isset($curl) && \is_resource($curl)) { \curl_close($curl); } if (isset($options[CURLOPT_INFILE]) && \is_resource($options[CURLOPT_INFILE])) { \fclose($options[CURLOPT_INFILE]); } throw $e; } } public function options(string $method, string $url, array $params = [], array $data = [], array $headers = [], string $user = null, string $password = null, int $timeout = null): array { $timeout = $timeout ?? self::DEFAULT_TIMEOUT; $options = $this->curlOptions + [ CURLOPT_URL => $url, CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_INFILESIZE => Null, CURLOPT_HTTPHEADER => [], CURLOPT_TIMEOUT => $timeout, ]; foreach ($headers as $key => $value) { $options[CURLOPT_HTTPHEADER][] = "$key: $value"; } if ($user && $password) { $options[CURLOPT_HTTPHEADER][] = 'Authorization: Basic ' . \base64_encode("$user:$password"); } $query = $this->buildQuery($params); if ($query) { $options[CURLOPT_URL] .= '?' . $query; } switch (\strtolower(\trim($method))) { case 'get': $options[CURLOPT_HTTPGET] = true; break; case 'post': $options[CURLOPT_POST] = true; if ($this->hasFile($data)) { [$headers, $body] = $this->buildMultipartOptions($data); $options[CURLOPT_POSTFIELDS] = $body; $options[CURLOPT_HTTPHEADER] = \array_merge($options[CURLOPT_HTTPHEADER], $headers); } else { $options[CURLOPT_POSTFIELDS] = $this->buildQuery($data); $options[CURLOPT_HTTPHEADER][] = 'Content-Type: application/x-www-form-urlencoded'; } break; case 'put': // TODO: PUT doesn't used anywhere and it has strange implementation. Must investigate later $options[CURLOPT_PUT] = true; if ($data) { if ($buffer = \fopen('php://memory', 'w+')) { $dataString = $this->buildQuery($data); \fwrite($buffer, $dataString); \fseek($buffer, 0); $options[CURLOPT_INFILE] = $buffer; $options[CURLOPT_INFILESIZE] = \strlen($dataString); } else { throw new EnvironmentException('Unable to open a temporary file'); } } break; case 'head': $options[CURLOPT_NOBODY] = true; break; default: $options[CURLOPT_CUSTOMREQUEST] = \strtoupper($method); } return $options; } public function buildQuery(?array $params): string { $parts = []; $params = $params ?: []; foreach ($params as $key => $value) { if (\is_array($value)) { foreach ($value as $item) { $parts[] = \urlencode((string)$key) . '=' . \urlencode((string)$item); } } else { $parts[] = \urlencode((string)$key) . '=' . \urlencode((string)$value); } } return \implode('&', $parts); } private function hasFile(array $data): bool { foreach ($data as $value) { if ($value instanceof File) { return true; } } return false; } private function buildMultipartOptions(array $data): array { $boundary = \uniqid('', true); $delimiter = "-------------{$boundary}"; $body = ''; foreach ($data as $key => $value) { if ($value instanceof File) { $contents = $value->getContents(); if ($contents === null) { $chunk = \file_get_contents($value->getFileName()); $filename = \basename($value->getFileName()); } elseif (\is_resource($contents)) { $chunk = ''; while (!\feof($contents)) { $chunk .= \fread($contents, 8096); } $filename = $value->getFileName(); } elseif (\is_string($contents)) { $chunk = $contents; $filename = $value->getFileName(); } else { throw new \InvalidArgumentException('Unsupported content type'); } $headers = ''; $contentType = $value->getContentType(); if ($contentType !== null) { $headers .= "Content-Type: {$contentType}\r\n"; } $body .= \vsprintf("--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\n%s\r\n%s\r\n", [ $delimiter, $key, $filename, $headers, $chunk, ]); } else { $body .= \vsprintf("--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", [ $delimiter, $key, $value, ]); } } $body .= "--{$delimiter}--\r\n"; return [ [ "Content-Type: multipart/form-data; boundary={$delimiter}", 'Content-Length: ' . \strlen($body), ], $body, ]; } } sdk/src/Twilio/Http/GuzzleClient.php000064400000006123150364341770013446 0ustar00client = $client; } public function request(string $method, string $url, array $params = [], array $data = [], array $headers = [], string $user = null, string $password = null, int $timeout = null): Response { try { $options = [ 'timeout' => $timeout, 'auth' => [$user, $password], 'allow_redirects' => false, ]; if ($params) { $options['query'] = Query::build($params, PHP_QUERY_RFC1738); } if ($method === 'POST') { if ($this->hasFile($data)) { $options['multipart'] = $this->buildMultipartParam($data); } else { $options['body'] = Query::build($data, PHP_QUERY_RFC1738); $headers['Content-Type'] = 'application/x-www-form-urlencoded'; } } $response = $this->client->send(new Request($method, $url, $headers), $options); } catch (BadResponseException $exception) { $response = $exception->getResponse(); } catch (\Exception $exception) { throw new HttpException('Unable to complete the HTTP request', 0, $exception); } // Casting the body (stream) to a string performs a rewind, ensuring we return the entire response. // See https://stackoverflow.com/a/30549372/86696 return new Response($response->getStatusCode(), (string)$response->getBody(), $response->getHeaders()); } private function hasFile(array $data): bool { foreach ($data as $value) { if ($value instanceof File) { return true; } } return false; } private function buildMultipartParam(array $data): array { $multipart = []; foreach ($data as $key => $value) { if ($value instanceof File) { $contents = $value->getContents(); if ($contents === null) { $contents = fopen($value->getFileName(), 'rb'); } $chunk = [ 'name' => $key, 'contents' => $contents, 'filename' => $value->getFileName(), ]; if ($value->getContentType() !== null) { $chunk['headers']['Content-Type'] = $value->getContentType(); } } else { $chunk = [ 'name' => $key, 'contents' => $value, ]; } $multipart[] = $chunk; } return $multipart; } } sdk/src/Twilio/Http/Client.php000064400000000514150364341770012243 0ustar00version = $version; } public function toArray(): array { return $this->properties; } public function __toString(): string { return '[InstanceResource]'; } public function __isset($name): bool { return \array_key_exists($name, $this->properties); } } sdk/src/Twilio/Values.php000064400000005255150364341770011354 0ustar00 $value) { if (!in_array($value, self::$noneConstants, true)) { $result[$key] = $value; } } return $result; } public function __construct(array $options) { $this->options = []; foreach ($options as $key => $value) { $this->options[\strtolower($key)] = $value; } } /** * (PHP 5 >= 5.0.0)
* Whether a offset exists * @link http://php.net/manual/en/arrayaccess.offsetexists.php * @param mixed $offset

* An offset to check for. *

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

*

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

* The offset to retrieve. *

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

* The offset to assign the value to. *

* @param mixed $value

* The value to set. *

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

* The offset to unset. *

* @return void */ public function offsetUnset($offset): void { unset($this->options[$offset]); } } sdk/src/Twilio/autoload.php000064400000012415150364341770011721 0ustar00. */ /** * SplClassLoader implementation that implements the technical interoperability * standards for PHP 5.3 namespaces and class names. * * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1 * * // Example which loads classes for the Doctrine Common package in the * // Doctrine\Common namespace. * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); * $classLoader->register(); * * @license http://www.opensource.org/licenses/mit-license.html MIT License * @author Jonathan H. Wage * @author Roman S. Borschel * @author Matthew Weier O'Phinney * @author Kris Wallsmith * @author Fabien Potencier */ class SplClassLoader { private $_fileExtension = '.php'; private $_namespace; private $_includePath; private $_namespaceSeparator = '\\'; /** * Creates a new SplClassLoader that loads classes of the * specified namespace. * * @param string $ns The namespace to use. * @param string $includePath The include path to search */ public function __construct($ns = null, $includePath = null) { $this->_namespace = $ns; $this->_includePath = $includePath; } /** * Sets the namespace separator used by classes in the namespace of this class loader. * * @param string $sep The separator to use. */ public function setNamespaceSeparator($sep): void { $this->_namespaceSeparator = $sep; } /** * Gets the namespace separator used by classes in the namespace of this class loader. * * @return string The separator to use. */ public function getNamespaceSeparator(): string { return $this->_namespaceSeparator; } /** * Sets the base include path for all class files in the namespace of this class loader. * * @param string $includePath */ public function setIncludePath($includePath): void { $this->_includePath = $includePath; } /** * Gets the base include path for all class files in the namespace of this class loader. * * @return string $includePath */ public function getIncludePath(): string { return $this->_includePath; } /** * Sets the file extension of class files in the namespace of this class loader. * * @param string $fileExtension */ public function setFileExtension($fileExtension): void { $this->_fileExtension = $fileExtension; } /** * Gets the file extension of class files in the namespace of this class loader. * * @return string $fileExtension */ public function getFileExtension(): string { return $this->_fileExtension; } /** * Installs this class loader on the SPL autoload stack. */ public function register(): void { \spl_autoload_register([$this, 'loadClass']); } /** * Uninstalls this class loader from the SPL autoloader stack. */ public function unregister(): void { \spl_autoload_unregister([$this, 'loadClass']); } /** * Loads the given class or interface. * * @param string $className The name of the class to load. * @return void */ public function loadClass($className): void { if (null === $this->_namespace || $this->_namespace . $this->_namespaceSeparator === \substr($className, 0, \strlen($this->_namespace . $this->_namespaceSeparator))) { $fileName = ''; $namespace = ''; if (false !== ($lastNsPos = \strripos($className, $this->_namespaceSeparator))) { $namespace = \substr($className, 0, $lastNsPos); $className = \substr($className, $lastNsPos + 1); $fileName = \str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; } $fileName .= \str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; } } } $twilioClassLoader = new SplClassLoader('Twilio', \realpath(__DIR__ . DIRECTORY_SEPARATOR . '..')); $twilioClassLoader->register(); sdk/src/Twilio/InstanceContext.php000064400000000464150364341770013223 0ustar00version = $version; } public function __toString(): string { return '[InstanceContext]'; } } sdk/src/Twilio/Options.php000064400000000336150364341770011543 0ustar00options); } } sdk/src/Twilio/Deserialize.php000064400000002440150364341770012346 0ustar00 0) { return new PhoneNumberCapabilities($arr); } } } catch (\Exception $e) { // no-op } return $arr; } } sdk/src/Twilio/Stream.php000064400000005435150364341770011350 0ustar00page = $page; $this->firstPage = $page; $this->limit = $limit; $this->currentRecord = 1; $this->pageLimit = $pageLimit; $this->currentPage = 1; } /** * (PHP 5 >= 5.0.0)
* Return the current element * @link http://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ #[\ReturnTypeWillChange] public function current() { return $this->page->current(); } /** * (PHP 5 >= 5.0.0)
* Move forward to next element * @link http://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ public function next(): void { $this->page->next(); $this->currentRecord++; if ($this->overLimit()) { return; } if (!$this->page->valid()) { if ($this->overPageLimit()) { return; } $this->page = $this->page->nextPage(); $this->currentPage++; } } /** * (PHP 5 >= 5.0.0)
* Return the key of the current element * @link http://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. */ #[\ReturnTypeWillChange] public function key() { return $this->currentRecord; } /** * (PHP 5 >= 5.0.0)
* Checks if current position is valid * @link http://php.net/manual/en/iterator.valid.php * @return bool The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ public function valid(): bool { return $this->page && $this->page->valid() && !$this->overLimit() && !$this->overPageLimit(); } /** * (PHP 5 >= 5.0.0)
* Rewind the Iterator to the first element * @link http://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ public function rewind(): void { $this->page = $this->firstPage; $this->page->rewind(); $this->currentPage = 1; $this->currentRecord = 1; } protected function overLimit(): bool { return ($this->limit !== null && $this->limit !== Values::NONE && $this->limit < $this->currentRecord); } protected function overPageLimit(): bool { return ($this->pageLimit !== null && $this->pageLimit !== Values::NONE && $this->pageLimit < $this->currentPage); } } sdk/src/Twilio/Security/RequestValidator.php000064400000013776150364341770015231 0ustar00validate($_SERVER['HTTP_X_TWILIO_SIGNATURE'], 'https://your-example-url.com/api/route/', $_REQUEST); * $isFromTwilio // <- if this is true, the request did come from Twilio, if not, it didn't */ class RequestValidator { /** * @access private * @var string The auth token to the Twilio Account */ private $authToken; /** * constructor * @access public * @param string $authToken the auth token of the Twilio user's account * Sets the account auth token to be used by the rest of the class */ public function __construct(string $authToken) { $this->authToken = $authToken; } /** * Creates the actual base64 encoded signature of the sha1 hash of the concatenated URL and your auth token * * @param string $url the full URL of the request URL you specify for your phone number or app, from the protocol (https...) through the end of the query string (everything after the ?) * @param array $data the Twilio parameters the request was made with * @return string */ public function computeSignature(string $url, array $data = []): string { // sort the array by keys \ksort($data); foreach ($data as $key => $value) { // convert a single value to an array or remove any duplicates $valueArray = \is_array($value) ? \array_unique($value) : array($value); // also sort all the values \sort($valueArray); // append them to the data string with no delimiters foreach ($valueArray as $item) { $url .= $key . $item; } } // sha1 then base64 the url to the auth token and return the base64-ed string return \base64_encode(\hash_hmac('sha1', $url, $this->authToken, true)); } /** * Converts the raw binary output to a hexadecimal return * * @param string $data * @return string */ public static function computeBodyHash(string $data = ''): string { return \bin2hex(\hash('sha256', $data, true)); } /** * The only method the client should be running...takes the Twilio signature, their URL, and the Twilio params and validates the signature * * @param string $expectedSignature * @param string $url * @param array|string $data * @return bool */ public function validate(string $expectedSignature, string $url, $data = []): bool { $parsedUrl = \parse_url($url); $urlWithPort = self::addPort($parsedUrl); $urlWithoutPort = self::removePort($parsedUrl); $validBodyHash = true; // May not receive body hash, so default succeed if (!\is_array($data)) { // handling if the data was passed through as a string instead of an array of params $queryString = \explode('?', $url); $queryString = $queryString[1]; \parse_str($queryString, $params); $validBodyHash = self::compare(self::computeBodyHash($data), Values::array_get($params, 'bodySHA256')); $data = []; } /* * Check signature of the URL with and without port information * since sig generation on the back end is inconsistent. */ $validSignatureWithPort = self::compare( $expectedSignature, $this->computeSignature($urlWithPort, $data) ); $validSignatureWithoutPort = self::compare( $expectedSignature, $this->computeSignature($urlWithoutPort, $data) ); return $validBodyHash && ($validSignatureWithPort || $validSignatureWithoutPort); } /** * Time insensitive compare, function's runtime is governed by the length * of the first argument, not the difference between the arguments. * * @param string $a First part of the comparison pair * @param string $b Second part of the comparison pair * @return bool True if $a === $b, false otherwise. */ public static function compare(?string $a, ?string $b): bool { if ($a && $b) { return hash_equals($a, $b); } return false; } /** * Removes the port from the URL * * @param array $parsedUrl * @return string Full URL without the port number */ private static function removePort(array $parsedUrl): string { unset($parsedUrl['port']); return self::unparse_url($parsedUrl); } /** * Adds the port to the URL * * @param array $parsedUrl * @return string Full URL with the port number */ private static function addPort(array $parsedUrl): string { if (!isset($parsedUrl['port'])) { $port = ($parsedUrl['scheme'] === 'https') ? 443 : 80; $parsedUrl['port'] = $port; } return self::unparse_url($parsedUrl); } /** * Builds the URL from its parsed component pieces * * @param array $parsedUrl * @return string Full URL */ static function unparse_url(array $parsedUrl): string { $parts = []; $parts['scheme'] = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] . '://' : ''; $parts['user'] = $parsedUrl['user'] ?? ''; $parts['pass'] = isset($parsedUrl['pass']) ? ':' . $parsedUrl['pass'] : ''; $parts['pass'] = ($parts['user'] || $parts['pass']) ? $parts['pass'] . '@' : ''; $parts['host'] = $parsedUrl['host'] ?? ''; $parts['port'] = isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : ''; $parts['path'] = $parsedUrl['path'] ?? ''; $parts['query'] = isset($parsedUrl['query']) ? '?' . $parsedUrl['query'] : ''; $parts['fragment'] = isset($parsedUrl['fragment']) ? '#' . $parsedUrl['fragment'] : ''; return \implode('', $parts); } } sdk/src/Twilio/Page.php000064400000013561150364341770010770 0ustar00processResponse($response); $this->version = $version; $this->payload = $payload; $this->solution = []; $this->records = new \ArrayIterator($this->loadPage()); } protected function processResponse(Response $response) { if ($response->getStatusCode() !== 200 && !$this->isPagingEol($response->getContent())) { $message = '[HTTP ' . $response->getStatusCode() . '] Unable to fetch page'; $code = $response->getStatusCode(); $content = $response->getContent(); $details = []; $moreInfo = ''; if (\is_array($content)) { $message .= isset($content['message']) ? ': ' . $content['message'] : ''; $code = $content['code'] ?? $code; $moreInfo = $content['more_info'] ?? ''; $details = $content['details'] ?? [] ; } throw new RestException($message, $code, $response->getStatusCode(), $moreInfo, $details); } return $response->getContent(); } protected function isPagingEol(?array $content): bool { return $content !== null && \array_key_exists('code', $content) && $content['code'] === 20006; } protected function hasMeta(string $key): bool { return \array_key_exists('meta', $this->payload) && \array_key_exists($key, $this->payload['meta']); } protected function getMeta(string $key, string $default = null): ?string { return $this->hasMeta($key) ? $this->payload['meta'][$key] : $default; } protected function loadPage(): array { $key = $this->getMeta('key'); if ($key) { return $this->payload[$key]; } $keys = \array_keys($this->payload); $key = \array_diff($keys, self::$metaKeys); $key = \array_values($key); if (\count($key) === 1) { return $this->payload[$key[0]]; } // handle end of results error code if ($this->isPagingEol($this->payload)) { return []; } throw new DeserializeException('Page Records can not be deserialized'); } public function getPreviousPageUrl(): ?string { if ($this->hasMeta('previous_page_url')) { return $this->getMeta('previous_page_url'); } else if (\array_key_exists('previous_page_uri', $this->payload) && $this->payload['previous_page_uri']) { return $this->getVersion()->getDomain()->absoluteUrl($this->payload['previous_page_uri']); } return null; } public function getNextPageUrl(): ?string { if ($this->hasMeta('next_page_url')) { return $this->getMeta('next_page_url'); } else if (\array_key_exists('next_page_uri', $this->payload) && $this->payload['next_page_uri']) { return $this->getVersion()->getDomain()->absoluteUrl($this->payload['next_page_uri']); } return null; } public function nextPage(): ?Page { if (!$this->getNextPageUrl()) { return null; } $response = $this->getVersion()->getDomain()->getClient()->request('GET', $this->getNextPageUrl()); return new static($this->getVersion(), $response, $this->solution); } public function previousPage(): ?Page { if (!$this->getPreviousPageUrl()) { return null; } $response = $this->getVersion()->getDomain()->getClient()->request('GET', $this->getPreviousPageUrl()); return new static($this->getVersion(), $response, $this->solution); } /** * (PHP 5 >= 5.0.0)
* Return the current element * @link http://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ #[\ReturnTypeWillChange] public function current() { return $this->buildInstance($this->records->current()); } /** * (PHP 5 >= 5.0.0)
* Move forward to next element * @link http://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ public function next(): void { $this->records->next(); } /** * (PHP 5 >= 5.0.0)
* Return the key of the current element * @link http://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. */ #[\ReturnTypeWillChange] public function key() { return $this->records->key(); } /** * (PHP 5 >= 5.0.0)
* Checks if current position is valid * @link http://php.net/manual/en/iterator.valid.php * @return bool The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ public function valid(): bool { return $this->records->valid(); } /** * (PHP 5 >= 5.0.0)
* Rewind the Iterator to the first element * @link http://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ public function rewind(): void { $this->records->rewind(); } public function getVersion(): Version { return $this->version; } public function __toString(): string { return '[Page]'; } } sdk/src/Twilio/TwiML/MessagingResponse.php000064400000001762150364341770014544 0ustar00nest(new Messaging\Message($body, $attributes)); } /** * Add Redirect child. * * @param string $url Redirect URL * @param array $attributes Optional attributes * @return Messaging\Redirect Child element. */ public function redirect($url, $attributes = []): Messaging\Redirect { return $this->nest(new Messaging\Redirect($url, $attributes)); } }sdk/src/Twilio/TwiML/Video/Room.php000064400000000572150364341770013070 0ustar00name = $name; $this->attributes = $attributes; $this->children = []; if ($value !== null) { $this->children[] = $value; } } /** * Add a TwiML element. * * @param TwiML|string $twiml TwiML element to add * @return TwiML $this */ public function append($twiml): TwiML { $this->children[] = $twiml; return $this; } /** * Add a TwiML element. * * @param TwiML $twiml TwiML element to add * @return TwiML added TwiML element */ public function nest(TwiML $twiml): TwiML { $this->children[] = $twiml; return $twiml; } /** * Set TwiML attribute. * * @param string $key name of attribute * @param string $value value of attribute * @return static $this */ public function setAttribute(string $key, string $value): TwiML { $this->attributes[$key] = $value; return $this; } /** * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes * @return TwiML */ public function addChild(string $name, string $value = null, array $attributes = []): TwiML { return $this->nest(new GenericNode($name, $value, $attributes)); } /** * Convert TwiML to XML string. * * @return string TwiML XML representation */ public function asXML(): string { return (string)$this; } /** * Convert TwiML to XML string. * * @return string TwiML XML representation */ public function __toString(): string { return $this->xml()->saveXML(); } /** * Build TwiML element. * * @param TwiML $twiml TwiML element to convert to XML * @param DOMDocument $document XML document for the element * @return DOMElement $element */ private function buildElement(TwiML $twiml, DOMDocument $document): DOMElement { $element = $document->createElement($twiml->name); foreach ($twiml->attributes as $name => $value) { if (\is_bool($value)) { $value = ($value === true) ? 'true' : 'false'; } $element->setAttribute($name, $value); } foreach ($twiml->children as $child) { if (\is_string($child)) { $element->appendChild($document->createTextNode($child)); } else { $element->appendChild($this->buildElement($child, $document)); } } return $element; } /** * Build XML element. * * @return DOMDocument Build TwiML element */ private function xml(): DOMDocument { $document = new DOMDocument('1.0', 'UTF-8'); $document->appendChild($this->buildElement($this, $document)); return $document; } } sdk/src/Twilio/TwiML/FaxResponse.php000064400000001107150364341770013336 0ustar00nest(new Fax\Receive($attributes)); } }sdk/src/Twilio/TwiML/GenericNode.php000064400000000713150364341770013265 0ustar00name = $name; $this->value = $value; } } sdk/src/Twilio/TwiML/Messaging/Redirect.php000064400000001256150364341770014564 0ustar00setAttribute('method', $method); } }sdk/src/Twilio/TwiML/Messaging/Body.php000064400000000611150364341770013712 0ustar00nest(new Body($message)); } /** * Add Media child. * * @param string $url Media URL * @return Media Child element. */ public function media($url): Media { return $this->nest(new Media($url)); } /** * Add To attribute. * * @param string $to Phone Number to send Message to */ public function setTo($to): self { return $this->setAttribute('to', $to); } /** * Add From attribute. * * @param string $from Phone Number to send Message from */ public function setFrom($from): self { return $this->setAttribute('from', $from); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL Method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL. Deprecated in favor of * action. */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } }sdk/src/Twilio/TwiML/Messaging/Media.php000064400000000575150364341770014045 0ustar00setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Receive action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add MediaType attribute. * * @param string $mediaType The media type used to store media in the fax media * store */ public function setMediaType($mediaType): self { return $this->setAttribute('mediaType', $mediaType); } /** * Add PageSize attribute. * * @param string $pageSize What size to interpret received pages as */ public function setPageSize($pageSize): self { return $this->setAttribute('pageSize', $pageSize); } /** * Add StoreMedia attribute. * * @param bool $storeMedia Whether or not to store received media in the fax * media store */ public function setStoreMedia($storeMedia): self { return $this->setAttribute('storeMedia', $storeMedia); } }sdk/src/Twilio/TwiML/VoiceResponse.php000064400000013153150364341770013671 0ustar00nest(new Voice\Connect($attributes)); } /** * Add Dial child. * * @param string $number Phone number to dial * @param array $attributes Optional attributes * @return Voice\Dial Child element. */ public function dial($number = null, $attributes = []): Voice\Dial { return $this->nest(new Voice\Dial($number, $attributes)); } /** * Add Echo child. * * @return Voice\Echo_ Child element. */ public function echo_(): Voice\Echo_ { return $this->nest(new Voice\Echo_()); } /** * Add Enqueue child. * * @param string $name Friendly name * @param array $attributes Optional attributes * @return Voice\Enqueue Child element. */ public function enqueue($name = null, $attributes = []): Voice\Enqueue { return $this->nest(new Voice\Enqueue($name, $attributes)); } /** * Add Gather child. * * @param array $attributes Optional attributes * @return Voice\Gather Child element. */ public function gather($attributes = []): Voice\Gather { return $this->nest(new Voice\Gather($attributes)); } /** * Add Hangup child. * * @return Voice\Hangup Child element. */ public function hangup(): Voice\Hangup { return $this->nest(new Voice\Hangup()); } /** * Add Leave child. * * @return Voice\Leave Child element. */ public function leave(): Voice\Leave { return $this->nest(new Voice\Leave()); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Voice\Pause Child element. */ public function pause($attributes = []): Voice\Pause { return $this->nest(new Voice\Pause($attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Voice\Play Child element. */ public function play($url = null, $attributes = []): Voice\Play { return $this->nest(new Voice\Play($url, $attributes)); } /** * Add Queue child. * * @param string $name Queue name * @param array $attributes Optional attributes * @return Voice\Queue Child element. */ public function queue($name, $attributes = []): Voice\Queue { return $this->nest(new Voice\Queue($name, $attributes)); } /** * Add Record child. * * @param array $attributes Optional attributes * @return Voice\Record Child element. */ public function record($attributes = []): Voice\Record { return $this->nest(new Voice\Record($attributes)); } /** * Add Redirect child. * * @param string $url Redirect URL * @param array $attributes Optional attributes * @return Voice\Redirect Child element. */ public function redirect($url, $attributes = []): Voice\Redirect { return $this->nest(new Voice\Redirect($url, $attributes)); } /** * Add Reject child. * * @param array $attributes Optional attributes * @return Voice\Reject Child element. */ public function reject($attributes = []): Voice\Reject { return $this->nest(new Voice\Reject($attributes)); } /** * Add Say child. * * @param string $message Message to say * @param array $attributes Optional attributes * @return Voice\Say Child element. */ public function say($message, $attributes = []): Voice\Say { return $this->nest(new Voice\Say($message, $attributes)); } /** * Add Sms child. * * @param string $message Message body * @param array $attributes Optional attributes * @return Voice\Sms Child element. */ public function sms($message, $attributes = []): Voice\Sms { return $this->nest(new Voice\Sms($message, $attributes)); } /** * Add Pay child. * * @param array $attributes Optional attributes * @return Voice\Pay Child element. */ public function pay($attributes = []): Voice\Pay { return $this->nest(new Voice\Pay($attributes)); } /** * Add Prompt child. * * @param array $attributes Optional attributes * @return Voice\Prompt Child element. */ public function prompt($attributes = []): Voice\Prompt { return $this->nest(new Voice\Prompt($attributes)); } /** * Add Start child. * * @param array $attributes Optional attributes * @return Voice\Start Child element. */ public function start($attributes = []): Voice\Start { return $this->nest(new Voice\Start($attributes)); } /** * Add Stop child. * * @return Voice\Stop Child element. */ public function stop(): Voice\Stop { return $this->nest(new Voice\Stop()); } /** * Add Refer child. * * @param array $attributes Optional attributes * @return Voice\Refer Child element. */ public function refer($attributes = []): Voice\Refer { return $this->nest(new Voice\Refer($attributes)); } }sdk/src/Twilio/TwiML/Voice/Room.php000064400000001463150364341770013067 0ustar00setAttribute('participantIdentity', $participantIdentity); } }sdk/src/Twilio/TwiML/Voice/SsmlEmphasis.php000064400000006221150364341770014560 0ustar00nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Level attribute. * * @param string $level Specify the degree of emphasis */ public function setLevel($level): self { return $this->setAttribute('level', $level); } }sdk/src/Twilio/TwiML/Voice/Echo_.php000064400000000510150364341770013160 0ustar00setAttribute('method', $method); } }sdk/src/Twilio/TwiML/Voice/Leave.php000064400000000512150364341770013201 0ustar00nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add Role attribute. * * @param string $role Customize the pronunciation of words by specifying the * word’s part of speech or alternate meaning */ public function setRole($role): self { return $this->setAttribute('role', $role); } }sdk/src/Twilio/TwiML/Voice/Siprec.php000064400000003620150364341770013375 0ustar00nest(new Parameter($attributes)); } /** * Add Name attribute. * * @param string $name Friendly name given to SIPREC */ public function setName($name): self { return $this->setAttribute('name', $name); } /** * Add ConnectorName attribute. * * @param string $connectorName Unique name for Connector */ public function setConnectorName($connectorName): self { return $this->setAttribute('connectorName', $connectorName); } /** * Add Track attribute. * * @param string $track Track to be streamed to remote service */ public function setTrack($track): self { return $this->setAttribute('track', $track); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } }sdk/src/Twilio/TwiML/Voice/Number.php000064400000011741150364341770013403 0ustar00setAttribute('sendDigits', $sendDigits); } /** * Add Url attribute. * * @param string $url TwiML URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method TwiML URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to call status callback */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add Byoc attribute. * * @param string $byoc BYOC trunk SID (Beta) */ public function setByoc($byoc): self { return $this->setAttribute('byoc', $byoc); } /** * Add MachineDetection attribute. * * @param string $machineDetection Enable machine detection or end of greeting * detection */ public function setMachineDetection($machineDetection): self { return $this->setAttribute('machineDetection', $machineDetection); } /** * Add AmdStatusCallbackMethod attribute. * * @param string $amdStatusCallbackMethod HTTP Method to use with * amd_status_callback */ public function setAmdStatusCallbackMethod($amdStatusCallbackMethod): self { return $this->setAttribute('amdStatusCallbackMethod', $amdStatusCallbackMethod); } /** * Add AmdStatusCallback attribute. * * @param string $amdStatusCallback The URL we should call to send amd status * information to your application */ public function setAmdStatusCallback($amdStatusCallback): self { return $this->setAttribute('amdStatusCallback', $amdStatusCallback); } /** * Add MachineDetectionTimeout attribute. * * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection */ public function setMachineDetectionTimeout($machineDetectionTimeout): self { return $this->setAttribute('machineDetectionTimeout', $machineDetectionTimeout); } /** * Add MachineDetectionSpeechThreshold attribute. * * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity */ public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold): self { return $this->setAttribute('machineDetectionSpeechThreshold', $machineDetectionSpeechThreshold); } /** * Add MachineDetectionSpeechEndThreshold attribute. * * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity */ public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold): self { return $this->setAttribute('machineDetectionSpeechEndThreshold', $machineDetectionSpeechEndThreshold); } /** * Add MachineDetectionSilenceTimeout attribute. * * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence */ public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout): self { return $this->setAttribute('machineDetectionSilenceTimeout', $machineDetectionSilenceTimeout); } }sdk/src/Twilio/TwiML/Voice/VirtualAgent.php000064400000005014150364341770014554 0ustar00nest(new Config($attributes)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add ConnectorName attribute. * * @param string $connectorName Defines the conversation profile Dialogflow * needs to use */ public function setConnectorName($connectorName): self { return $this->setAttribute('connectorName', $connectorName); } /** * Add Language attribute. * * @param string $language Language to be used by Dialogflow to transcribe * speech */ public function setLanguage($language): self { return $this->setAttribute('language', $language); } /** * Add SentimentAnalysis attribute. * * @param bool $sentimentAnalysis Whether sentiment analysis needs to be * enabled or not */ public function setSentimentAnalysis($sentimentAnalysis): self { return $this->setAttribute('sentimentAnalysis', $sentimentAnalysis); } /** * Add StatusCallback attribute. * * @param string $statusCallback URL to post status callbacks from Twilio */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod HTTP method to use when requesting the * status callback URL */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } }sdk/src/Twilio/TwiML/Voice/Gather.php000064400000013407150364341770013366 0ustar00nest(new Say($message, $attributes)); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Pause Child element. */ public function pause($attributes = []): Pause { return $this->nest(new Pause($attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Play Child element. */ public function play($url = null, $attributes = []): Play { return $this->nest(new Play($url, $attributes)); } /** * Add Input attribute. * * @param string[] $input Input type Twilio should accept */ public function setInput($input): self { return $this->setAttribute('input', $input); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Time to wait to gather input */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } /** * Add SpeechTimeout attribute. * * @param string $speechTimeout Time to wait to gather speech input and it * should be either auto or a positive integer. */ public function setSpeechTimeout($speechTimeout): self { return $this->setAttribute('speechTimeout', $speechTimeout); } /** * Add MaxSpeechTime attribute. * * @param int $maxSpeechTime Max allowed time for speech input */ public function setMaxSpeechTime($maxSpeechTime): self { return $this->setAttribute('maxSpeechTime', $maxSpeechTime); } /** * Add ProfanityFilter attribute. * * @param bool $profanityFilter Profanity Filter on speech */ public function setProfanityFilter($profanityFilter): self { return $this->setAttribute('profanityFilter', $profanityFilter); } /** * Add FinishOnKey attribute. * * @param string $finishOnKey Finish gather on key */ public function setFinishOnKey($finishOnKey): self { return $this->setAttribute('finishOnKey', $finishOnKey); } /** * Add NumDigits attribute. * * @param int $numDigits Number of digits to collect */ public function setNumDigits($numDigits): self { return $this->setAttribute('numDigits', $numDigits); } /** * Add PartialResultCallback attribute. * * @param string $partialResultCallback Partial result callback URL */ public function setPartialResultCallback($partialResultCallback): self { return $this->setAttribute('partialResultCallback', $partialResultCallback); } /** * Add PartialResultCallbackMethod attribute. * * @param string $partialResultCallbackMethod Partial result callback URL method */ public function setPartialResultCallbackMethod($partialResultCallbackMethod): self { return $this->setAttribute('partialResultCallbackMethod', $partialResultCallbackMethod); } /** * Add Language attribute. * * @param string $language Language to use */ public function setLanguage($language): self { return $this->setAttribute('language', $language); } /** * Add Hints attribute. * * @param string $hints Speech recognition hints */ public function setHints($hints): self { return $this->setAttribute('hints', $hints); } /** * Add BargeIn attribute. * * @param bool $bargeIn Stop playing media upon speech */ public function setBargeIn($bargeIn): self { return $this->setAttribute('bargeIn', $bargeIn); } /** * Add Debug attribute. * * @param bool $debug Allow debug for gather */ public function setDebug($debug): self { return $this->setAttribute('debug', $debug); } /** * Add ActionOnEmptyResult attribute. * * @param bool $actionOnEmptyResult Force webhook to the action URL event if * there is no input */ public function setActionOnEmptyResult($actionOnEmptyResult): self { return $this->setAttribute('actionOnEmptyResult', $actionOnEmptyResult); } /** * Add SpeechModel attribute. * * @param string $speechModel Specify the model that is best suited for your * use case */ public function setSpeechModel($speechModel): self { return $this->setAttribute('speechModel', $speechModel); } /** * Add Enhanced attribute. * * @param bool $enhanced Use enhanced speech model */ public function setEnhanced($enhanced): self { return $this->setAttribute('enhanced', $enhanced); } }sdk/src/Twilio/TwiML/Voice/SsmlS.php000064400000005516150364341770013217 0ustar00nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } }sdk/src/Twilio/TwiML/Voice/Reject.php000064400000001577150364341770013375 0ustar00nest(new Parameter($attributes)); } /** * Add Reason attribute. * * @param string $reason Rejection reason */ public function setReason($reason): self { return $this->setAttribute('reason', $reason); } }sdk/src/Twilio/TwiML/Voice/Sim.php000064400000000572150364341770012703 0ustar00setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Timeout to begin recording */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } /** * Add FinishOnKey attribute. * * @param string $finishOnKey Finish recording on key */ public function setFinishOnKey($finishOnKey): self { return $this->setAttribute('finishOnKey', $finishOnKey); } /** * Add MaxLength attribute. * * @param int $maxLength Max time to record in seconds */ public function setMaxLength($maxLength): self { return $this->setAttribute('maxLength', $maxLength); } /** * Add PlayBeep attribute. * * @param bool $playBeep Play beep */ public function setPlayBeep($playBeep): self { return $this->setAttribute('playBeep', $playBeep); } /** * Add Trim attribute. * * @param string $trim Trim the recording */ public function setTrim($trim): self { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Status callback URL */ public function setRecordingStatusCallback($recordingStatusCallback): self { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Status callback URL method */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string[] $recordingStatusCallbackEvent Recording status callback * events */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add Transcribe attribute. * * @param bool $transcribe Transcribe the recording */ public function setTranscribe($transcribe): self { return $this->setAttribute('transcribe', $transcribe); } /** * Add TranscribeCallback attribute. * * @param string $transcribeCallback Transcribe callback URL */ public function setTranscribeCallback($transcribeCallback): self { return $this->setAttribute('transcribeCallback', $transcribeCallback); } }sdk/src/Twilio/TwiML/Voice/SsmlP.php000064400000006045150364341770013212 0ustar00nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words): SsmlS { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } }sdk/src/Twilio/TwiML/Voice/Dial.php000064400000016605150364341770013030 0ustar00nest(new Client($identity, $attributes)); } /** * Add Conference child. * * @param string $name Conference name * @param array $attributes Optional attributes * @return Conference Child element. */ public function conference($name, $attributes = []): Conference { return $this->nest(new Conference($name, $attributes)); } /** * Add Number child. * * @param string $phoneNumber Phone Number to dial * @param array $attributes Optional attributes * @return Number Child element. */ public function number($phoneNumber, $attributes = []): Number { return $this->nest(new Number($phoneNumber, $attributes)); } /** * Add Queue child. * * @param string $name Queue name * @param array $attributes Optional attributes * @return Queue Child element. */ public function queue($name, $attributes = []): Queue { return $this->nest(new Queue($name, $attributes)); } /** * Add Sim child. * * @param string $simSid SIM SID * @return Sim Child element. */ public function sim($simSid): Sim { return $this->nest(new Sim($simSid)); } /** * Add Sip child. * * @param string $sipUrl SIP URL * @param array $attributes Optional attributes * @return Sip Child element. */ public function sip($sipUrl, $attributes = []): Sip { return $this->nest(new Sip($sipUrl, $attributes)); } /** * Add Application child. * * @param string $applicationSid Application sid * @param array $attributes Optional attributes * @return Application Child element. */ public function application($applicationSid = null, $attributes = []): Application { return $this->nest(new Application($applicationSid, $attributes)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Time to wait for answer */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } /** * Add HangupOnStar attribute. * * @param bool $hangupOnStar Hangup call on star press */ public function setHangupOnStar($hangupOnStar): self { return $this->setAttribute('hangupOnStar', $hangupOnStar); } /** * Add TimeLimit attribute. * * @param int $timeLimit Max time length */ public function setTimeLimit($timeLimit): self { return $this->setAttribute('timeLimit', $timeLimit); } /** * Add CallerId attribute. * * @param string $callerId Caller ID to display */ public function setCallerId($callerId): self { return $this->setAttribute('callerId', $callerId); } /** * Add Record attribute. * * @param string $record Record the call */ public function setRecord($record): self { return $this->setAttribute('record', $record); } /** * Add Trim attribute. * * @param string $trim Trim the recording */ public function setTrim($trim): self { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Recording status callback URL */ public function setRecordingStatusCallback($recordingStatusCallback): self { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Recording status callback URL * method */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string[] $recordingStatusCallbackEvent Recording status callback * events */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add AnswerOnBridge attribute. * * @param bool $answerOnBridge Preserve the ringing behavior of the inbound * call until the Dialed call picks up */ public function setAnswerOnBridge($answerOnBridge): self { return $this->setAttribute('answerOnBridge', $answerOnBridge); } /** * Add RingTone attribute. * * @param string $ringTone Ringtone allows you to override the ringback tone * that Twilio will play back to the caller while * executing the Dial */ public function setRingTone($ringTone): self { return $this->setAttribute('ringTone', $ringTone); } /** * Add RecordingTrack attribute. * * @param string $recordingTrack To indicate which audio track should be * recorded */ public function setRecordingTrack($recordingTrack): self { return $this->setAttribute('recordingTrack', $recordingTrack); } /** * Add Sequential attribute. * * @param bool $sequential Used to determine if child TwiML nouns should be * dialed in order, one after the other (sequential) or * dial all at once (parallel). Default is false, * parallel */ public function setSequential($sequential): self { return $this->setAttribute('sequential', $sequential); } /** * Add ReferUrl attribute. * * @param string $referUrl Webhook that will receive future SIP REFER requests */ public function setReferUrl($referUrl): self { return $this->setAttribute('referUrl', $referUrl); } /** * Add ReferMethod attribute. * * @param string $referMethod The HTTP method to use for the refer Webhook */ public function setReferMethod($referMethod): self { return $this->setAttribute('referMethod', $referMethod); } }sdk/src/Twilio/TwiML/Voice/Conversation.php000064400000010414150364341770014621 0ustar00setAttribute('serviceInstanceSid', $serviceInstanceSid); } /** * Add InboundAutocreation attribute. * * @param bool $inboundAutocreation Inbound autocreation */ public function setInboundAutocreation($inboundAutocreation): self { return $this->setAttribute('inboundAutocreation', $inboundAutocreation); } /** * Add RoutingAssignmentTimeout attribute. * * @param int $routingAssignmentTimeout Routing assignment timeout */ public function setRoutingAssignmentTimeout($routingAssignmentTimeout): self { return $this->setAttribute('routingAssignmentTimeout', $routingAssignmentTimeout); } /** * Add InboundTimeout attribute. * * @param int $inboundTimeout Inbound timeout */ public function setInboundTimeout($inboundTimeout): self { return $this->setAttribute('inboundTimeout', $inboundTimeout); } /** * Add Url attribute. * * @param string $url TwiML URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method TwiML URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add Record attribute. * * @param string $record Record */ public function setRecord($record): self { return $this->setAttribute('record', $record); } /** * Add Trim attribute. * * @param string $trim Trim */ public function setTrim($trim): self { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Recording status callback URL */ public function setRecordingStatusCallback($recordingStatusCallback): self { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Recording status callback URL * method */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string[] $recordingStatusCallbackEvent Recording status callback * events */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to call status callback URL */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } }sdk/src/Twilio/TwiML/Voice/Sms.php000064400000002776150364341770012725 0ustar00setAttribute('to', $to); } /** * Add From attribute. * * @param string $from Number to send message from */ public function setFrom($from): self { return $this->setAttribute('from', $from); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } }sdk/src/Twilio/TwiML/Voice/SsmlBreak.php000064400000001714150364341770014035 0ustar00setAttribute('strength', $strength); } /** * Add Time attribute. * * @param string $time Set a pause to a specific length of time in seconds or * milliseconds, available values: [number]s, [number]ms */ public function setTime($time): self { return $this->setAttribute('time', $time); } }sdk/src/Twilio/TwiML/Voice/Hangup.php000064400000001130150364341770013364 0ustar00nest(new Parameter($attributes)); } }sdk/src/Twilio/TwiML/Voice/Identity.php000064400000000670150364341770013743 0ustar00setAttribute('muted', $muted); } /** * Add Beep attribute. * * @param string $beep Play beep when joining */ public function setBeep($beep): self { return $this->setAttribute('beep', $beep); } /** * Add StartConferenceOnEnter attribute. * * @param bool $startConferenceOnEnter Start the conference on enter */ public function setStartConferenceOnEnter($startConferenceOnEnter): self { return $this->setAttribute('startConferenceOnEnter', $startConferenceOnEnter); } /** * Add EndConferenceOnExit attribute. * * @param bool $endConferenceOnExit End the conferenceon exit */ public function setEndConferenceOnExit($endConferenceOnExit): self { return $this->setAttribute('endConferenceOnExit', $endConferenceOnExit); } /** * Add WaitUrl attribute. * * @param string $waitUrl Wait URL */ public function setWaitUrl($waitUrl): self { return $this->setAttribute('waitUrl', $waitUrl); } /** * Add WaitMethod attribute. * * @param string $waitMethod Wait URL method */ public function setWaitMethod($waitMethod): self { return $this->setAttribute('waitMethod', $waitMethod); } /** * Add MaxParticipants attribute. * * @param int $maxParticipants Maximum number of participants */ public function setMaxParticipants($maxParticipants): self { return $this->setAttribute('maxParticipants', $maxParticipants); } /** * Add Record attribute. * * @param string $record Record the conference */ public function setRecord($record): self { return $this->setAttribute('record', $record); } /** * Add Region attribute. * * @param string $region Conference region */ public function setRegion($region): self { return $this->setAttribute('region', $region); } /** * Add Coach attribute. * * @param string $coach Call coach */ public function setCoach($coach): self { return $this->setAttribute('coach', $coach); } /** * Add Trim attribute. * * @param string $trim Trim the conference recording */ public function setTrim($trim): self { return $this->setAttribute('trim', $trim); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to call status callback URL */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Recording status callback URL */ public function setRecordingStatusCallback($recordingStatusCallback): self { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Recording status callback URL * method */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string[] $recordingStatusCallbackEvent Recording status callback * events */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add EventCallbackUrl attribute. * * @param string $eventCallbackUrl Event callback URL */ public function setEventCallbackUrl($eventCallbackUrl): self { return $this->setAttribute('eventCallbackUrl', $eventCallbackUrl); } /** * Add JitterBufferSize attribute. * * @param string $jitterBufferSize Size of jitter buffer for participant */ public function setJitterBufferSize($jitterBufferSize): self { return $this->setAttribute('jitterBufferSize', $jitterBufferSize); } /** * Add ParticipantLabel attribute. * * @param string $participantLabel A label for participant */ public function setParticipantLabel($participantLabel): self { return $this->setAttribute('participantLabel', $participantLabel); } }sdk/src/Twilio/TwiML/Voice/Config.php000064400000001514150364341770013355 0ustar00setAttribute('name', $name); } /** * Add Value attribute. * * @param string $value The value of the custom config */ public function setValue($value): self { return $this->setAttribute('value', $value); } }sdk/src/Twilio/TwiML/Voice/SsmlProsody.php000064400000010347150364341770014452 0ustar00nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add P child. * * @param string $words Words to speak * @return SsmlP Child element. */ public function p($words): SsmlP { return $this->nest(new SsmlP($words)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words): SsmlS { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Volume attribute. * * @param string $volume Specify the volume, available values: default, silent, * x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ public function setVolume($volume): self { return $this->setAttribute('volume', $volume); } /** * Add Rate attribute. * * @param string $rate Specify the rate, available values: x-slow, slow, * medium, fast, x-fast, n% */ public function setRate($rate): self { return $this->setAttribute('rate', $rate); } /** * Add Pitch attribute. * * @param string $pitch Specify the pitch, available values: default, x-low, * low, medium, high, x-high, +n%, -n% */ public function setPitch($pitch): self { return $this->setAttribute('pitch', $pitch); } }sdk/src/Twilio/TwiML/Voice/Sip.php000064400000011631150364341770012704 0ustar00setAttribute('username', $username); } /** * Add Password attribute. * * @param string $password SIP Password */ public function setPassword($password): self { return $this->setAttribute('password', $password); } /** * Add Url attribute. * * @param string $url Action URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Status callback events */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add MachineDetection attribute. * * @param string $machineDetection Enable machine detection or end of greeting * detection */ public function setMachineDetection($machineDetection): self { return $this->setAttribute('machineDetection', $machineDetection); } /** * Add AmdStatusCallbackMethod attribute. * * @param string $amdStatusCallbackMethod HTTP Method to use with * amd_status_callback */ public function setAmdStatusCallbackMethod($amdStatusCallbackMethod): self { return $this->setAttribute('amdStatusCallbackMethod', $amdStatusCallbackMethod); } /** * Add AmdStatusCallback attribute. * * @param string $amdStatusCallback The URL we should call to send amd status * information to your application */ public function setAmdStatusCallback($amdStatusCallback): self { return $this->setAttribute('amdStatusCallback', $amdStatusCallback); } /** * Add MachineDetectionTimeout attribute. * * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection */ public function setMachineDetectionTimeout($machineDetectionTimeout): self { return $this->setAttribute('machineDetectionTimeout', $machineDetectionTimeout); } /** * Add MachineDetectionSpeechThreshold attribute. * * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity */ public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold): self { return $this->setAttribute('machineDetectionSpeechThreshold', $machineDetectionSpeechThreshold); } /** * Add MachineDetectionSpeechEndThreshold attribute. * * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity */ public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold): self { return $this->setAttribute('machineDetectionSpeechEndThreshold', $machineDetectionSpeechEndThreshold); } /** * Add MachineDetectionSilenceTimeout attribute. * * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence */ public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout): self { return $this->setAttribute('machineDetectionSilenceTimeout', $machineDetectionSilenceTimeout); } }sdk/src/Twilio/TwiML/Voice/Refer.php000064400000002033150364341770013210 0ustar00nest(new ReferSip($sipUrl)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } }sdk/src/Twilio/TwiML/Voice/ApplicationSid.php000064400000000642150364341770015054 0ustar00nest(new Stream($attributes)); } /** * Add Siprec child. * * @param array $attributes Optional attributes * @return Siprec Child element. */ public function siprec($attributes = []): Siprec { return $this->nest(new Siprec($attributes)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } }sdk/src/Twilio/TwiML/Voice/SsmlSayAs.php000064400000002007150364341770014025 0ustar00setAttribute('interpret-as', $interpretAs); } /** * Add Format attribute. * * @param string $format Specify the format of the date when interpret-as is * set to date */ public function setFormat($format): self { return $this->setAttribute('format', $format); } }sdk/src/Twilio/TwiML/Voice/SsmlSub.php000064400000001432150364341770013537 0ustar00setAttribute('alias', $alias); } }sdk/src/Twilio/TwiML/Voice/Stream.php000064400000004174150364341770013410 0ustar00nest(new Parameter($attributes)); } /** * Add Name attribute. * * @param string $name Friendly name given to the Stream */ public function setName($name): self { return $this->setAttribute('name', $name); } /** * Add ConnectorName attribute. * * @param string $connectorName Unique name for Stream Connector */ public function setConnectorName($connectorName): self { return $this->setAttribute('connectorName', $connectorName); } /** * Add Url attribute. * * @param string $url URL of the remote service where the Stream is routed */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Track attribute. * * @param string $track Track to be streamed to remote service */ public function setTrack($track): self { return $this->setAttribute('track', $track); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } }sdk/src/Twilio/TwiML/Voice/ReferSip.php000064400000000604150364341770013666 0ustar00setAttribute('alphabet', $alphabet); } /** * Add Ph attribute. * * @param string $ph Specifiy the phonetic symbols for pronunciation */ public function setPh($ph): self { return $this->setAttribute('ph', $ph); } }sdk/src/Twilio/TwiML/Voice/Queue.php000064400000002604150364341770013235 0ustar00setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add ReservationSid attribute. * * @param string $reservationSid TaskRouter Reservation SID */ public function setReservationSid($reservationSid): self { return $this->setAttribute('reservationSid', $reservationSid); } /** * Add PostWorkActivitySid attribute. * * @param string $postWorkActivitySid TaskRouter Activity SID */ public function setPostWorkActivitySid($postWorkActivitySid): self { return $this->setAttribute('postWorkActivitySid', $postWorkActivitySid); } }sdk/src/Twilio/TwiML/Voice/Stop.php000064400000001477150364341770013105 0ustar00nest(new Stream($attributes)); } /** * Add Siprec child. * * @param array $attributes Optional attributes * @return Siprec Child element. */ public function siprec($attributes = []): Siprec { return $this->nest(new Siprec($attributes)); } }sdk/src/Twilio/TwiML/Voice/Application.php000064400000005562150364341770014422 0ustar00nest(new ApplicationSid($sid)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Url attribute. * * @param string $url TwiML URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method TwiML URL Method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to trigger status callback */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL Method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add CustomerId attribute. * * @param string $customerId Identity of the customer calling application */ public function setCustomerId($customerId): self { return $this->setAttribute('customerId', $customerId); } /** * Add CopyParentTo attribute. * * @param bool $copyParentTo Copy parent call To field to called application * side, otherwise use the application sid as To field */ public function setCopyParentTo($copyParentTo): self { return $this->setAttribute('copyParentTo', $copyParentTo); } }sdk/src/Twilio/TwiML/Voice/SsmlLang.php000064400000007063150364341770013675 0ustar00nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add P child. * * @param string $words Words to speak * @return SsmlP Child element. */ public function p($words): SsmlP { return $this->nest(new SsmlP($words)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words): SsmlS { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Xml:Lang attribute. * * @param string $xmlLang Specify the language */ public function setXmlLang($xmlLang): self { return $this->setAttribute('xml:Lang', $xmlLang); } }sdk/src/Twilio/TwiML/Voice/Pay.php000064400000013532150364341770012704 0ustar00nest(new Prompt($attributes)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Input attribute. * * @param string $input Input type Twilio should accept */ public function setInput($input): self { return $this->setAttribute('input', $input); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add BankAccountType attribute. * * @param string $bankAccountType Bank account type for ach transactions. If * set, payment method attribute must be * provided and value should be set to * ach-debit. defaults to consumer-checking */ public function setBankAccountType($bankAccountType): self { return $this->setAttribute('bankAccountType', $bankAccountType); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add Timeout attribute. * * @param int $timeout Time to wait to gather input */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } /** * Add MaxAttempts attribute. * * @param int $maxAttempts Maximum number of allowed retries when gathering * input */ public function setMaxAttempts($maxAttempts): self { return $this->setAttribute('maxAttempts', $maxAttempts); } /** * Add SecurityCode attribute. * * @param bool $securityCode Prompt for security code */ public function setSecurityCode($securityCode): self { return $this->setAttribute('securityCode', $securityCode); } /** * Add PostalCode attribute. * * @param string $postalCode Prompt for postal code and it should be true/false * or default postal code */ public function setPostalCode($postalCode): self { return $this->setAttribute('postalCode', $postalCode); } /** * Add MinPostalCodeLength attribute. * * @param int $minPostalCodeLength Prompt for minimum postal code length */ public function setMinPostalCodeLength($minPostalCodeLength): self { return $this->setAttribute('minPostalCodeLength', $minPostalCodeLength); } /** * Add PaymentConnector attribute. * * @param string $paymentConnector Unique name for payment connector */ public function setPaymentConnector($paymentConnector): self { return $this->setAttribute('paymentConnector', $paymentConnector); } /** * Add PaymentMethod attribute. * * @param string $paymentMethod Payment method to be used. defaults to * credit-card */ public function setPaymentMethod($paymentMethod): self { return $this->setAttribute('paymentMethod', $paymentMethod); } /** * Add TokenType attribute. * * @param string $tokenType Type of token */ public function setTokenType($tokenType): self { return $this->setAttribute('tokenType', $tokenType); } /** * Add ChargeAmount attribute. * * @param string $chargeAmount Amount to process. If value is greater than 0 * then make the payment else create a payment token */ public function setChargeAmount($chargeAmount): self { return $this->setAttribute('chargeAmount', $chargeAmount); } /** * Add Currency attribute. * * @param string $currency Currency of the amount attribute */ public function setCurrency($currency): self { return $this->setAttribute('currency', $currency); } /** * Add Description attribute. * * @param string $description Details regarding the payment */ public function setDescription($description): self { return $this->setAttribute('description', $description); } /** * Add ValidCardTypes attribute. * * @param string[] $validCardTypes Comma separated accepted card types */ public function setValidCardTypes($validCardTypes): self { return $this->setAttribute('validCardTypes', $validCardTypes); } /** * Add Language attribute. * * @param string $language Language to use */ public function setLanguage($language): self { return $this->setAttribute('language', $language); } }sdk/src/Twilio/TwiML/Voice/Task.php000064400000001620150364341770013050 0ustar00setAttribute('priority', $priority); } /** * Add Timeout attribute. * * @param int $timeout Timeout associated with task */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } }sdk/src/Twilio/TwiML/Voice/Pause.php000064400000001170150364341770013223 0ustar00setAttribute('length', $length); } }sdk/src/Twilio/TwiML/Voice/Connect.php000064400000004236150364341770013545 0ustar00nest(new Room($name, $attributes)); } /** * Add Autopilot child. * * @param string $name Autopilot assistant sid or unique name * @return Autopilot Child element. */ public function autopilot($name): Autopilot { return $this->nest(new Autopilot($name)); } /** * Add Stream child. * * @param array $attributes Optional attributes * @return Stream Child element. */ public function stream($attributes = []): Stream { return $this->nest(new Stream($attributes)); } /** * Add VirtualAgent child. * * @param array $attributes Optional attributes * @return VirtualAgent Child element. */ public function virtualAgent($attributes = []): VirtualAgent { return $this->nest(new VirtualAgent($attributes)); } /** * Add Conversation child. * * @param array $attributes Optional attributes * @return Conversation Child element. */ public function conversation($attributes = []): Conversation { return $this->nest(new Conversation($attributes)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } }sdk/src/Twilio/TwiML/Voice/Say.php000064400000007670150364341770012715 0ustar00nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add P child. * * @param string $words Words to speak * @return SsmlP Child element. */ public function p($words): SsmlP { return $this->nest(new SsmlP($words)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words): SsmlS { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Voice attribute. * * @param string $voice Voice to use */ public function setVoice($voice): self { return $this->setAttribute('voice', $voice); } /** * Add Loop attribute. * * @param int $loop Times to loop message */ public function setLoop($loop): self { return $this->setAttribute('loop', $loop); } /** * Add Language attribute. * * @param string $language Message language */ public function setLanguage($language): self { return $this->setAttribute('language', $language); } }sdk/src/Twilio/TwiML/Voice/Play.php000064400000001554150364341770013061 0ustar00setAttribute('loop', $loop); } /** * Add Digits attribute. * * @param string $digits Play DTMF tones for digits */ public function setDigits($digits): self { return $this->setAttribute('digits', $digits); } }sdk/src/Twilio/TwiML/Voice/Client.php000064400000004365150364341770013375 0ustar00nest(new Identity($clientIdentity)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Url attribute. * * @param string $url Client URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Client URL Method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to trigger status callback */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL Method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } }sdk/src/Twilio/TwiML/Voice/Parameter.php000064400000001533150364341770014071 0ustar00setAttribute('name', $name); } /** * Add Value attribute. * * @param string $value The value of the custom parameter */ public function setValue($value): self { return $this->setAttribute('value', $value); } }sdk/src/Twilio/TwiML/Voice/Prompt.php000064400000004765150364341770013444 0ustar00nest(new Say($message, $attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Play Child element. */ public function play($url = null, $attributes = []): Play { return $this->nest(new Play($url, $attributes)); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Pause Child element. */ public function pause($attributes = []): Pause { return $this->nest(new Pause($attributes)); } /** * Add For_ attribute. * * @param string $for_ Name of the payment source data element */ public function setFor_($for_): self { return $this->setAttribute('for_', $for_); } /** * Add ErrorType attribute. * * @param string[] $errorType Type of error */ public function setErrorType($errorType): self { return $this->setAttribute('errorType', $errorType); } /** * Add CardType attribute. * * @param string[] $cardType Type of the credit card */ public function setCardType($cardType): self { return $this->setAttribute('cardType', $cardType); } /** * Add Attempt attribute. * * @param int[] $attempt Current attempt count */ public function setAttempt($attempt): self { return $this->setAttribute('attempt', $attempt); } /** * Add RequireMatchingInputs attribute. * * @param bool $requireMatchingInputs Require customer to input requested * information twice and verify matching. */ public function setRequireMatchingInputs($requireMatchingInputs): self { return $this->setAttribute('requireMatchingInputs', $requireMatchingInputs); } }sdk/src/Twilio/TwiML/Voice/Autopilot.php000064400000000645150364341770014134 0ustar00nest(new Task($body, $attributes)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add MaxQueueSize attribute. * * @param int $maxQueueSize Maximum size of queue */ public function setMaxQueueSize($maxQueueSize): self { return $this->setAttribute('maxQueueSize', $maxQueueSize); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add WaitUrl attribute. * * @param string $waitUrl Wait URL */ public function setWaitUrl($waitUrl): self { return $this->setAttribute('waitUrl', $waitUrl); } /** * Add WaitUrlMethod attribute. * * @param string $waitUrlMethod Wait URL method */ public function setWaitUrlMethod($waitUrlMethod): self { return $this->setAttribute('waitUrlMethod', $waitUrlMethod); } /** * Add WorkflowSid attribute. * * @param string $workflowSid TaskRouter Workflow SID */ public function setWorkflowSid($workflowSid): self { return $this->setAttribute('workflowSid', $workflowSid); } }sdk/src/Twilio/Jwt/Client/ScopeURI.php000064400000003251150364341770013522 0ustar00:? * * For example: * scope:client:incoming?name=jonas */ class ScopeURI { public $service; public $privilege; public $params; public function __construct(string $service, string $privilege, array $params = []) { $this->service = $service; $this->privilege = $privilege; $this->params = $params; } public function toString(): string { $uri = "scope:{$this->service}:{$this->privilege}"; if (\count($this->params)) { $uri .= '?' . \http_build_query($this->params, '', '&'); } return $uri; } /** * Parse a scope URI into a ScopeURI object * * @param string $uri The scope URI * @return ScopeURI The parsed scope uri * @throws \UnexpectedValueException */ public static function parse(string $uri): ScopeURI { if (\strpos($uri, 'scope:') !== 0) { throw new \UnexpectedValueException( 'Not a scope URI according to scheme'); } $parts = \explode('?', $uri, 1); $params = null; if (\count($parts) > 1) { \parse_str($parts[1], $params); } $parts = \explode(':', $parts[0], 2); if (\count($parts) !== 3) { throw new \UnexpectedValueException( 'Not enough parts for scope URI'); } [$scheme, $service, $privilege] = $parts; return new ScopeURI($service, $privilege, $params); } } sdk/src/Twilio/Jwt/AccessToken.php000064400000010005150364341770013050 0ustar00signingKeySid = $signingKeySid; $this->accountSid = $accountSid; $this->secret = $secret; $this->ttl = $ttl; $this->region = $region; if ($identity !== null) { $this->identity = $identity; } $this->grants = []; $this->customClaims = []; } /** * Set the identity of this access token * * @param string $identity identity of the grant * * @return $this updated access token */ public function setIdentity(string $identity): self { $this->identity = $identity; return $this; } /** * Returns the identity of the grant * * @return string the identity */ public function getIdentity(): string { return $this->identity; } /** * Set the nbf of this access token * * @param int $nbf nbf in epoch seconds of the grant * * @return $this updated access token */ public function setNbf(int $nbf): self { $this->nbf = $nbf; return $this; } /** * Returns the nbf of the grant * * @return int the nbf in epoch seconds */ public function getNbf(): int { return $this->nbf; } /** * Set the region of this access token * * @param string $region Home region of the account sid in this access token * * @return $this updated access token */ public function setRegion(string $region): self { $this->region = $region; return $this; } /** * Returns the region of this access token * * @return string Home region of the account sid in this access token */ public function getRegion(): string { return $this->region; } /** * Add a grant to the access token * * @param Grant $grant to be added * * @return $this the updated access token */ public function addGrant(Grant $grant): self { $this->grants[] = $grant; return $this; } /** * Allows to set custom claims, which then will be encoded into JWT payload. * * @param string $name * @param string $value */ public function addClaim(string $name, string $value): void { $this->customClaims[$name] = $value; } public function toJWT(string $algorithm = 'HS256'): string { $header = [ 'cty' => 'twilio-fpa;v=1', 'typ' => 'JWT' ]; if ($this->region) { $header['twr'] = $this->region; } $now = \time(); $grants = []; if ($this->identity) { $grants['identity'] = $this->identity; } foreach ($this->grants as $grant) { $payload = $grant->getPayload(); if (empty($payload)) { $payload = \json_decode('{}'); } $grants[$grant->getGrantKey()] = $payload; } if (empty($grants)) { $grants = \json_decode('{}'); } $payload = \array_merge($this->customClaims, [ 'jti' => $this->signingKeySid . '-' . $now, 'iss' => $this->signingKeySid, 'sub' => $this->accountSid, 'exp' => $now + $this->ttl, 'grants' => $grants ]); if ($this->nbf !== null) { $payload['nbf'] = $this->nbf; } return JWT::encode($payload, $this->secret, $algorithm, $header); } public function __toString(): string { return $this->toJWT(); } } sdk/src/Twilio/Jwt/TaskRouter/CapabilityToken.php000064400000013013150364341770016035 0ustar00 * @license http://creativecommons.org/licenses/MIT/ MIT */ class CapabilityToken { protected $accountSid; protected $authToken; private $friendlyName; /** @var Policy[] $policies */ private $policies; protected $baseUrl = 'https://taskrouter.twilio.com/v1'; protected $baseWsUrl = 'https://event-bridge.twilio.com/v1/wschannels'; protected $version = 'v1'; protected $workspaceSid; protected $channelId; protected $resourceUrl; protected $required = ['required' => true]; protected $optional = ['required' => false]; public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $channelId, string $resourceUrl = null, string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) { $this->accountSid = $accountSid; $this->authToken = $authToken; $this->friendlyName = $channelId; $this->policies = []; $this->workspaceSid = $workspaceSid; $this->channelId = $channelId; if (isset($overrideBaseUrl)) { $this->baseUrl = $overrideBaseUrl; } if (isset($overrideBaseWSUrl)) { $this->baseWsUrl = $overrideBaseWSUrl; } $this->baseUrl .= '/Workspaces/' . $workspaceSid; $this->validateJWT(); if (!isset($resourceUrl)) { $this->setupResource(); } //add permissions to GET and POST to the event-bridge channel $this->allow($this->baseWsUrl . '/' . $this->accountSid . '/' . $this->channelId, 'GET', null, null); $this->allow($this->baseWsUrl . '/' . $this->accountSid . '/' . $this->channelId, 'POST', null, null); //add permissions to fetch the instance resource $this->allow($this->resourceUrl, 'GET', null, null); } protected function setupResource(): void { } public function addPolicyDeconstructed(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = [], bool $allow = true): Policy { $policy = new Policy($url, $method, $queryFilter, $postFilter, $allow); $this->policies[] = $policy; return $policy; } public function allow(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = []): void { $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, true); } public function deny(string $url, string $method, array $queryFilter = [], array $postFilter = []): void { $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, false); } private function validateJWT(): void { if (!isset($this->accountSid) || \strpos($this->accountSid, 'AC') !== 0) { throw new \Exception('Invalid AccountSid provided: ' . $this->accountSid); } if (!isset($this->workspaceSid) || \strpos($this->workspaceSid, 'WS') !== 0) { throw new \Exception('Invalid WorkspaceSid provided: ' . $this->workspaceSid); } if (!isset($this->channelId)) { throw new \Exception('ChannelId not provided'); } $prefix = \substr($this->channelId, 0, 2); if ($prefix !== 'WS' && $prefix !== 'WK' && $prefix !== 'WQ') { throw new \Exception("Invalid ChannelId provided: " . $this->channelId); } } public function allowFetchSubresources(): void { $method = 'GET'; $queryFilter = []; $postFilter = []; $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); } public function allowUpdates(): void { $method = 'POST'; $queryFilter = []; $postFilter = []; $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); } public function allowUpdatesSubresources(): void { $method = 'POST'; $queryFilter = []; $postFilter = []; $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); } public function allowDelete(): void { $method = 'DELETE'; $queryFilter = []; $postFilter = []; $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); } public function allowDeleteSubresources(): void { $method = 'DELETE'; $queryFilter = []; $postFilter = []; $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); } public function generateToken(int $ttl = 3600, array $extraAttributes = []): string { $payload = [ 'version' => $this->version, 'friendly_name' => $this->friendlyName, 'iss' => $this->accountSid, 'exp' => \time() + $ttl, 'account_sid' => $this->accountSid, 'channel' => $this->channelId, 'workspace_sid' => $this->workspaceSid ]; if (\strpos($this->channelId, 'WK') === 0) { $payload['worker_sid'] = $this->channelId; } else if (\strpos($this->channelId, 'WQ') === 0) { $payload['taskqueue_sid'] = $this->channelId; } foreach ($extraAttributes as $key => $value) { $payload[$key] = $value; } $policyStrings = []; foreach ($this->policies as $policy) { $policyStrings[] = $policy->toArray(); } $payload['policies'] = $policyStrings; return JWT::encode($payload, $this->authToken, 'HS256'); } } sdk/src/Twilio/Jwt/TaskRouter/WorkspaceCapability.php000064400000001013150364341770016710 0ustar00resourceUrl = $this->baseUrl; } } sdk/src/Twilio/Jwt/TaskRouter/Policy.php000064400000003032150364341770014212 0ustar00 * @license http://creativecommons.org/licenses/MIT/ MIT */ class Policy { private $url; private $method; private $queryFilter; private $postFilter; private $allow; public function __construct(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = [], bool $allow = true) { $this->url = $url; $this->method = $method; $this->queryFilter = $queryFilter; $this->postFilter = $postFilter; $this->allow = $allow; } public function addQueryFilter($queryFilter): void { $this->queryFilter[] = $queryFilter; } public function addPostFilter($postFilter): void { $this->postFilter[] = $postFilter; } public function toArray(): array { $policy_array = ['url' => $this->url, 'method' => $this->method, 'allow' => $this->allow]; if ($this->queryFilter !== null) { if (\count($this->queryFilter) > 0) { $policy_array['query_filter'] = $this->queryFilter; } else { $policy_array['query_filter'] = new \stdClass(); } } if ($this->postFilter !== null) { if (\count($this->postFilter) > 0) { $policy_array['post_filter'] = $this->postFilter; } else { $policy_array['post_filter'] = new \stdClass(); } } return $policy_array; } } sdk/src/Twilio/Jwt/TaskRouter/TaskQueueCapability.php000064400000001354150364341770016671 0ustar00 * @license http://creativecommons.org/licenses/MIT/ MIT */ class TaskQueueCapability extends CapabilityToken { public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $taskQueueSid, string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) { parent::__construct($accountSid, $authToken, $workspaceSid, $taskQueueSid, null, $overrideBaseUrl, $overrideBaseWSUrl); } protected function setupResource(): void { $this->resourceUrl = $this->baseUrl . '/TaskQueues/' . $this->channelId; } } sdk/src/Twilio/Jwt/TaskRouter/WorkerCapability.php000064400000003470150364341770016234 0ustar00 * @license http://creativecommons.org/licenses/MIT/ MIT */ class WorkerCapability extends CapabilityToken { private $tasksUrl; private $workerReservationsUrl; private $activityUrl; public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $workerSid, string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) { parent::__construct($accountSid, $authToken, $workspaceSid, $workerSid, null, $overrideBaseUrl, $overrideBaseWSUrl); $this->tasksUrl = $this->baseUrl . '/Tasks/**'; $this->activityUrl = $this->baseUrl . '/Activities'; $this->workerReservationsUrl = $this->resourceUrl . '/Reservations/**'; //add permissions to fetch the list of activities, tasks, and worker reservations $this->allow($this->activityUrl, 'GET', null, null); $this->allow($this->tasksUrl, 'GET', null, null); $this->allow($this->workerReservationsUrl, 'GET', null, null); } protected function setupResource(): void { $this->resourceUrl = $this->baseUrl . '/Workers/' . $this->channelId; } public function allowActivityUpdates(): void { $method = 'POST'; $queryFilter = []; $postFilter = ['ActivitySid' => $this->required]; $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); } public function allowReservationUpdates(): void { $method = 'POST'; $queryFilter = []; $postFilter = []; $this->allow($this->tasksUrl, $method, $queryFilter, $postFilter); $this->allow($this->workerReservationsUrl, $method, $queryFilter, $postFilter); } } sdk/src/Twilio/Jwt/ClientToken.php000064400000010257150364341770013076 0ustar00accountSid = $accountSid; $this->authToken = $authToken; $this->scopes = []; $this->clientName = false; $this->customClaims = []; } /** * If the user of this token should be allowed to accept incoming * connections then configure the TwilioCapability through this method and * specify the client name. * * @param string $clientName * @throws \InvalidArgumentException */ public function allowClientIncoming(string $clientName): void { // clientName must be a non-zero length alphanumeric string if (\preg_match('/\W/', $clientName)) { throw new \InvalidArgumentException( 'Only alphanumeric characters allowed in client name.'); } if ($clientName === '') { throw new \InvalidArgumentException( 'Client name must not be a zero length string.'); } $this->clientName = $clientName; $this->allow('client', 'incoming', ['clientName' => $clientName]); } /** * Allow the user of this token to make outgoing connections. * * @param string $appSid the application to which this token grants access * @param mixed[] $appParams signed parameters that the user of this token * cannot overwrite. */ public function allowClientOutgoing(string $appSid, array $appParams = []): void { $this->allow('client', 'outgoing', [ 'appSid' => $appSid, 'appParams' => \http_build_query($appParams, '', '&') ]); } /** * Allow the user of this token to access their event stream. * * @param mixed[] $filters key/value filters to apply to the event stream */ public function allowEventStream(array $filters = []): void { $this->allow('stream', 'subscribe', [ 'path' => '/2010-04-01/Events', 'params' => \http_build_query($filters, '', '&'), ]); } /** * Allows to set custom claims, which then will be encoded into JWT payload. * * @param string $name * @param string $value */ public function addClaim(string $name, string $value): void { $this->customClaims[$name] = $value; } /** * Generates a new token based on the credentials and permissions that * previously has been granted to this token. * * @param int $ttl the expiration time of the token (in seconds). Default * value is 3600 (1hr) * @return string the newly generated token that is valid for $ttl seconds */ public function generateToken(int $ttl = 3600): string { $payload = \array_merge($this->customClaims, [ 'scope' => [], 'iss' => $this->accountSid, 'exp' => \time() + $ttl, ]); $scopeStrings = []; foreach ($this->scopes as $scope) { if ($scope->privilege === 'outgoing' && $this->clientName) { $scope->params['clientName'] = $this->clientName; } $scopeStrings[] = $scope->toString(); } $payload['scope'] = \implode(' ', $scopeStrings); return JWT::encode($payload, $this->authToken, 'HS256'); } protected function allow(string $service, string $privilege, array $params): void { $this->scopes[] = new ScopeURI($service, $privilege, $params); } } sdk/src/Twilio/Jwt/Grants/Grant.php000064400000000511150364341770013160 0ustar00workspaceSid; } /** * Set the workspace sid of this grant * * @param string $workspaceSid workspace sid of the grant * * @return $this updated grant */ public function setWorkspaceSid(string $workspaceSid): self { $this->workspaceSid = $workspaceSid; return $this; } /** * Returns the worker sid * * @return string the worker sid */ public function getWorkerSid(): string { return $this->workerSid; } /** * Set the worker sid of this grant * * @param string $workerSid worker sid of the grant * * @return $this updated grant */ public function setWorkerSid(string $workerSid): self { $this->workerSid = $workerSid; return $this; } /** * Returns the role * * @return string the role */ public function getRole(): string { return $this->role; } /** * Set the role of this grant * * @param string $role role of the grant * * @return $this updated grant */ public function setRole(string $role): self { $this->role = $role; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey(): string { return 'task_router'; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload(): array { $payload = []; if ($this->workspaceSid) { $payload['workspace_sid'] = $this->workspaceSid; } if ($this->workerSid) { $payload['worker_sid'] = $this->workerSid; } if ($this->role) { $payload['role'] = $this->role; } return $payload; } } sdk/src/Twilio/Jwt/Grants/ChatGrant.php000064400000005766150364341770014001 0ustar00serviceSid; } /** * Set the service sid of this grant * * @param string $serviceSid service sid of the grant * * @return $this updated grant */ public function setServiceSid(string $serviceSid): self { $this->serviceSid = $serviceSid; return $this; } /** * Returns the endpoint id of the grant * * @return string the endpoint id */ public function getEndpointId(): string { return $this->endpointId; } /** * Set the endpoint id of the grant * * @param string $endpointId endpoint id of the grant * * @return $this updated grant */ public function setEndpointId(string $endpointId): self { $this->endpointId = $endpointId; return $this; } /** * Returns the deployment role sid of the grant * * @return string the deployment role sid */ public function getDeploymentRoleSid(): string { return $this->deploymentRoleSid; } /** * Set the role sid of the grant * * @param string $deploymentRoleSid role sid of the grant * * @return $this updated grant */ public function setDeploymentRoleSid(string $deploymentRoleSid): self { $this->deploymentRoleSid = $deploymentRoleSid; return $this; } /** * Returns the push credential sid of the grant * * @return string the push credential sid */ public function getPushCredentialSid(): string { return $this->pushCredentialSid; } /** * Set the credential sid of the grant * * @param string $pushCredentialSid push credential sid of the grant * * @return $this updated grant */ public function setPushCredentialSid(string $pushCredentialSid): self { $this->pushCredentialSid = $pushCredentialSid; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey(): string { return 'chat'; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload(): array { $payload = []; if ($this->serviceSid) { $payload['service_sid'] = $this->serviceSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } if ($this->deploymentRoleSid) { $payload['deployment_role_sid'] = $this->deploymentRoleSid; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } return $payload; } } sdk/src/Twilio/Jwt/Grants/PlaybackGrant.php000064400000001756150364341770014643 0ustar00grant; } /** * Set the playback grant that will allow access to a stream * * @param array $grant playback grant from Twilio API * @return $this updated grant */ public function setGrant(array $grant): self { $this->grant = $grant; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey(): string { return 'player'; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload(): array { $payload = []; if ($this->grant) { $payload = $this->grant; } return $payload; } } sdk/src/Twilio/Jwt/Grants/VoiceGrant.php000064400000010004150364341770014144 0ustar00incomingAllow; } /** * Set whether incoming is allowed * * @param bool $incomingAllow whether incoming is allowed * * @return $this updated grant */ public function setIncomingAllow(bool $incomingAllow): self { $this->incomingAllow = $incomingAllow; return $this; } /** * Returns the outgoing application sid * * @return string the outgoing application sid */ public function getOutgoingApplicationSid(): string { return $this->outgoingApplicationSid; } /** * Set the outgoing application sid of the grant * * @param string $outgoingApplicationSid outgoing application sid of grant * * @return $this updated grant */ public function setOutgoingApplicationSid(string $outgoingApplicationSid): self { $this->outgoingApplicationSid = $outgoingApplicationSid; return $this; } /** * Returns the outgoing application params * * @return array the outgoing application params */ public function getOutgoingApplicationParams(): array { return $this->outgoingApplicationParams; } /** * Set the outgoing application of the the grant * * @param string $sid outgoing application sid of the grant * @param array $params params to pass the the application * * @return $this updated grant */ public function setOutgoingApplication(string $sid, array $params): self { $this->outgoingApplicationSid = $sid; $this->outgoingApplicationParams = $params; return $this; } /** * Returns the push credential sid * * @return string the push credential sid */ public function getPushCredentialSid(): string { return $this->pushCredentialSid; } /** * Set the push credential sid * * @param string $pushCredentialSid * * @return $this updated grant */ public function setPushCredentialSid(string $pushCredentialSid): self { $this->pushCredentialSid = $pushCredentialSid; return $this; } /** * Returns the endpoint id * * @return string the endpoint id */ public function getEndpointId(): string { return $this->endpointId; } /** * Set the endpoint id * * @param string $endpointId endpoint id * * @return $this updated grant */ public function setEndpointId(string $endpointId): self { $this->endpointId = $endpointId; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey(): string { return 'voice'; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload(): array { $payload = []; if ($this->incomingAllow === true) { $incoming = []; $incoming['allow'] = true; $payload['incoming'] = $incoming; } if ($this->outgoingApplicationSid) { $outgoing = []; $outgoing['application_sid'] = $this->outgoingApplicationSid; if ($this->outgoingApplicationParams) { $outgoing['params'] = $this->outgoingApplicationParams; } $payload['outgoing'] = $outgoing; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } return $payload; } } sdk/src/Twilio/Jwt/Grants/SyncGrant.php000064400000005771150364341770014032 0ustar00serviceSid; } /** * Set the service sid of this grant * * @param string $serviceSid service sid of the grant * * @return $this updated grant */ public function setServiceSid(string $serviceSid): self { $this->serviceSid = $serviceSid; return $this; } /** * Returns the endpoint id of the grant * * @return string the endpoint id */ public function getEndpointId(): string { return $this->endpointId; } /** * Set the endpoint id of the grant * * @param string $endpointId endpoint id of the grant * * @return $this updated grant */ public function setEndpointId(string $endpointId): self { $this->endpointId = $endpointId; return $this; } /** * Returns the deployment role sid of the grant * * @return string the deployment role sid */ public function getDeploymentRoleSid(): string { return $this->deploymentRoleSid; } /** * Set the role sid of the grant * * @param string $deploymentRoleSid role sid of the grant * * @return $this updated grant */ public function setDeploymentRoleSid(string $deploymentRoleSid): self { $this->deploymentRoleSid = $deploymentRoleSid; return $this; } /** * Returns the push credential sid of the grant * * @return string the push credential sid */ public function getPushCredentialSid(): string { return $this->pushCredentialSid; } /** * Set the credential sid of the grant * * @param string $pushCredentialSid push credential sid of the grant * * @return $this updated grant */ public function setPushCredentialSid(string $pushCredentialSid): self { $this->pushCredentialSid = $pushCredentialSid; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey(): string { return 'data_sync'; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload(): array { $payload = []; if ($this->serviceSid) { $payload['service_sid'] = $this->serviceSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } if ($this->deploymentRoleSid) { $payload['deployment_role_sid'] = $this->deploymentRoleSid; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } return $payload; } } sdk/src/Twilio/Jwt/Grants/VideoGrant.php000064400000001753150364341770014160 0ustar00room; } /** * Set the room to allow access to in the grant * * @param string $roomSidOrName room sid or name * @return $this updated grant */ public function setRoom(string $roomSidOrName): self { $this->room = $roomSidOrName; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey(): string { return 'video'; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload(): array { $payload = []; if ($this->room) { $payload['room'] = $this->room; } return $payload; } } sdk/src/Twilio/Jwt/JWT.php000064400000013601150364341770011317 0ustar00 */ class JWT { /** * @param string $jwt The JWT * @param string|null $key The secret key * @param bool $verify Don't skip verification process * @return object The JWT's payload as a PHP object * @throws \DomainException * @throws \UnexpectedValueException */ public static function decode(string $jwt, string $key = null, bool $verify = true) { $tks = \explode('.', $jwt); if (\count($tks) !== 3) { throw new \UnexpectedValueException('Wrong number of segments'); } list($headb64, $payloadb64, $cryptob64) = $tks; if (null === ($header = self::jsonDecode(self::urlsafeB64Decode($headb64))) ) { throw new \UnexpectedValueException('Invalid segment encoding'); } if (null === $payload = self::jsonDecode(self::urlsafeB64Decode($payloadb64)) ) { throw new \UnexpectedValueException('Invalid segment encoding'); } $sig = self::urlsafeB64Decode($cryptob64); if ($verify) { if (empty($header->alg)) { throw new \DomainException('Empty algorithm'); } if (!hash_equals($sig, self::sign("$headb64.$payloadb64", $key, $header->alg))) { throw new \UnexpectedValueException('Signature verification failed'); } } return $payload; } /** * @param string $jwt The JWT * @return object The JWT's header as a PHP object * @throws \UnexpectedValueException */ public static function getHeader(string $jwt) { $tks = \explode('.', $jwt); if (\count($tks) !== 3) { throw new \UnexpectedValueException('Wrong number of segments'); } list($headb64) = $tks; if (null === ($header = self::jsonDecode(self::urlsafeB64Decode($headb64))) ) { throw new \UnexpectedValueException('Invalid segment encoding'); } return $header; } /** * @param object|array $payload PHP object or array * @param string $key The secret key * @param string $algo The signing algorithm * @param array $additionalHeaders Additional keys/values to add to the header * * @return string A JWT */ public static function encode($payload, string $key, string $algo = 'HS256', array $additionalHeaders = []): string { $header = ['typ' => 'JWT', 'alg' => $algo]; $header += $additionalHeaders; $segments = []; $segments[] = self::urlsafeB64Encode(self::jsonEncode($header)); $segments[] = self::urlsafeB64Encode(self::jsonEncode($payload)); $signing_input = \implode('.', $segments); $signature = self::sign($signing_input, $key, $algo); $segments[] = self::urlsafeB64Encode($signature); return \implode('.', $segments); } /** * @param string $msg The message to sign * @param string $key The secret key * @param string $method The signing algorithm * @return string An encrypted message * @throws \DomainException */ public static function sign(string $msg, string $key, string $method = 'HS256'): string { $methods = [ 'HS256' => 'sha256', 'HS384' => 'sha384', 'HS512' => 'sha512', ]; if (empty($methods[$method])) { throw new \DomainException('Algorithm not supported'); } return \hash_hmac($methods[$method], $msg, $key, true); } /** * @param string $input JSON string * @return object Object representation of JSON string * @throws \DomainException */ public static function jsonDecode(string $input) { $obj = \json_decode($input); if (\function_exists('json_last_error') && $errno = \json_last_error()) { self::handleJsonError($errno); } else if ($obj === null && $input !== 'null') { throw new \DomainException('Null result with non-null input'); } return $obj; } /** * @param object|array $input A PHP object or array * @return string JSON representation of the PHP object or array * @throws \DomainException */ public static function jsonEncode($input): string { $json = \json_encode($input); if (\function_exists('json_last_error') && $errno = \json_last_error()) { self::handleJsonError($errno); } else if ($json === 'null' && $input !== null) { throw new \DomainException('Null result with non-null input'); } return $json; } /** * @param string $input A base64 encoded string * * @return string A decoded string */ public static function urlsafeB64Decode(string $input): string { $padLen = 4 - \strlen($input) % 4; $input .= \str_repeat('=', $padLen); return \base64_decode(\strtr($input, '-_', '+/')); } /** * @param string $input Anything really * * @return string The base64 encode of what you passed in */ public static function urlsafeB64Encode(string $input): string { return \str_replace('=', '', \strtr(\base64_encode($input), '+/', '-_')); } /** * @param int $errno An error number from json_last_error() * * @throws \DomainException */ private static function handleJsonError(int $errno): void { $messages = [ JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON' ]; throw new \DomainException($messages[$errno] ?? 'Unknown JSON error: ' . $errno); } } sdk/src/Twilio/Domain.php000064400000004105150364341770011315 0ustar00client = $client; $this->baseUrl = ''; } /** * Translate version relative URIs into absolute URLs * * @param string $uri Version relative URI * @return string Absolute URL for this domain */ public function absoluteUrl(string $uri): string { return \implode('/', [\trim($this->baseUrl, '/'), \trim($uri, '/')]); } /** * Make an HTTP request to the domain * * @param string $method HTTP Method to make the request with * @param string $uri Relative uri to make a request to * @param array $params Query string arguments * @param array $data Post form data * @param array $headers HTTP headers to send with the request * @param string $user User to authenticate as * @param string $password Password * @param int $timeout Request timeout * @return Response the response for the request */ public function request(string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $user = null, string $password = null, int $timeout = null): Response { $url = $this->absoluteUrl($uri); return $this->client->request( $method, $url, $params, $data, $headers, $user, $password, $timeout ); } public function getClient(): Client { return $this->client; } public function __toString(): string { return '[Domain]'; } } sdk/src/Twilio/VersionInfo.php000064400000000360150364341770012346 0ustar00 sdk/.github/workflows/test-and-deploy.yml000064400000010174150364341770014473 0ustar00name: Test and Deploy on: push: branches: [ '*' ] tags: [ '*' ] pull_request: branches: [ main ] schedule: # Run automatically at 8AM PST Monday-Friday - cron: '0 15 * * 1-5' workflow_dispatch: jobs: test: name: Test runs-on: ubuntu-latest timeout-minutes: 20 strategy: matrix: php: [ 7.2, 7.3, 7.4, 8.0, 8.1 ] dependencies: - "lowest" - "highest" steps: - name: Checkout twilio-php uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Setup PHP Action uses: shivammathur/setup-php@2.15.0 with: php-version: ${{ matrix.php }} coverage: xdebug id: php - name: Composer webhook config run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} - name: Update Dependencies if: matrix.dependencies == 'lowest' run: composer update --prefer-lowest --prefer-stable -n - name: Run Tests run: make install test - name: Fix code coverage paths run: | if [ -f "coverage.xml" ]; then sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml fi - name: Run Cluster Test if: (!github.event.pull_request.head.repo.fork) env: TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} run: make cluster-test - name: Install SonarCloud scanner and run analysis uses: SonarSource/sonarcloud-github-action@master if: (github.event_name == 'pull_request' || github.ref_type == 'branch') && !github.event.pull_request.head.repo.fork && matrix.php == '8.1' && matrix.dependencies == 'highest' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} deploy: name: Deploy if: success() && github.ref_type == 'tag' needs: [ test ] runs-on: ubuntu-latest steps: - name: Checkout twilio-php uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install dependencies run: composer install - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_AUTH_TOKEN }} # The expression strips off the shortest match from the front of the string to yield just the tag name as the output - name: Get tagged version run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Create GitHub Release uses: sendgrid/dx-automator/actions/release@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build & Push docker image run: make docker-build docker-push - name: Submit metric to Datadog uses: sendgrid/dx-automator/actions/datadog-release-metric@main env: DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} notify-on-failure: name: Slack notify on failure if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') needs: [ test, deploy ] runs-on: ubuntu-latest steps: - uses: rtCamp/action-slack-notify@v2 env: SLACK_COLOR: failure SLACK_ICON_EMOJI: ':github:' SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }} SLACK_TITLE: Action Failure - ${{ github.repository }} SLACK_USERNAME: GitHub Actions SLACK_MSG_AUTHOR: twilio-dx SLACK_FOOTER: Posted automatically using GitHub Actions SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} MSG_MINIMAL: truesdk/.github/workflows/pr-lint.yml000064400000000655150364341770013052 0ustar00name: Lint PR on: pull_request_target: types: [ opened, edited, synchronize, reopened ] jobs: validate: name: Validate title runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5 with: types: | chore docs fix feat misc test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} sdk/.github/ISSUE_TEMPLATE/config.yml000064400000000575150364341770013061 0ustar00contact_links: - name: Twilio Support url: https://twilio.com/help/contact about: Get Support - name: Stack Overflow url: https://stackoverflow.com/questions/tagged/twilio-php+or+twilio+php about: Ask questions on Stack Overflow - name: Documentation url: https://www.twilio.com/docs/libraries/reference/twilio-php about: View Reference Documentation sdk/Dockerfile000064400000000430150364341770007326 0ustar00FROM php:7.4 RUN apt-get update -y && apt-get install -y zip RUN mkdir /twilio WORKDIR /twilio ENV PATH="vendor/bin:$PATH" COPY src src COPY tests tests COPY composer* ./ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN composer install --prefer-dist sdk/PULL_REQUEST_TEMPLATE.md000064400000003157150364341770011146 0ustar00 # Fixes # A short description of what this PR does. ### Checklist - [x] I acknowledge that all my contributions will be made under the project's license - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) - [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-php/blob/main/CONTRIBUTING.md) and my PR follows them - [ ] I have titled the PR appropriately - [ ] I have updated my branch with the main branch - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository. sdk/Dockerfile-dev000064400000000570150364341770010107 0ustar00ARG version FROM php:$version RUN curl --silent --show-error https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get dist-upgrade -y && \ apt-get -y autoremove && \ apt-get clean RUN apt-get install -y zip unzip git ENV COMPOSER_ALLOW_SUPERUSER=1 WORKDIR /twilio sdk/sonar-project.properties000064400000000533150364341770012244 0ustar00sonar.projectKey=twilio_twilio-php sonar.projectName=twilio-php sonar.organization=twilio sonar.sources=src/ sonar.exclusions=src/Twilio/Rest/**/*, src/Twilio/TwiML/*/*, src/Twilio/TwiML/*Response.php sonar.tests=tests/ sonar.test.exclusions=tests/Twilio/Integration/**/* # For Code Coverage analysis sonar.php.coverage.reportPaths=coverage.xml sdk/advanced-examples/custom-http-client.md000064400000015367150364341770015021 0ustar00# Custom HTTP Clients for the Twilio PHP Helper Library If you are working with the Twilio PHP Helper Library and need to modify the HTTP requests that the library makes to the Twilio servers you’re in the right place. The most common place you'll need to alter the HTTP request is to connect and authenticate with an enterprise’s proxy server. We’ll provide sample code that you can drop right into your app to handle this use case. ## Connect and authenticate with a proxy server To connect and provide credentials to a proxy server between your app and Twilio, you need a way to modify the HTTP requests that the Twilio helper library makes to invoke the Twilio REST API. In PHP, the Twilio helper library uses the [cURL](http://php.net/manual/en/book.curl.php) library under the hood to make HTTP requests. The Twilio Helper Library allows you to provide your own `HttpClient` for making API requests. How do we apply this to a typical Twilio REST API example? ```php messages ->create( "+15558675310", array( 'body' => "Hey there!", 'from' => "+15017122661" ) ); ``` Where does `HttpClient` get created and used? Out of the box, the helper library is creating a default `RequestClient` for you, using the Twilio credentials you pass to the `init` method. However, there’s nothing stopping you from creating your own `RequestClient`. Once you have your own `RequestClient`, you can pass it to any Twilio REST API resource action you want. Here’s an example of sending an SMS message with a custom client: ```php load(); use Twilio\Rest\Client; // Your Account Sid and Auth Token from twilio.com/console $sid = getenv('ACCOUNT_SID'); $token = getenv('AUTH_TOKEN'); $proxy = getenv('PROXY'); $httpClient = new MyRequestClass($proxy); $twilio = new Client($sid, $token, null, null, $httpClient); $message = $twilio->messages ->create( "+15558675310", array( 'body' => "Hey there!", 'from' => "+15017122661" ) ); print("Message SID: {$message->sid}"); ``` ## Call Twilio through a proxy server Now that we understand how all the components fit together we can create our own `HttpClient` that can connect through a proxy server. To make this reusable, here’s a class that you can use to create this `HttpClient` whenever you need one. ```php proxy = $proxy; $this->cainfo = $cainfo; $this->http = new CurlClient(); } public function request( $method, $url, $params = array(), $data = array(), $headers = array(), $user = null, $password = null, $timeout = null): Response { // Here you can change the URL, headers and other request parameters $options = $this->options( $method, $url, $params, $data, $headers, $user, $password, $timeout ); $curl = curl_init($url); curl_setopt_array($curl, $options); if (!empty($this->proxy)) curl_setopt($curl, CURLOPT_PROXY, $this->proxy); if (!empty($this->cainfo)) curl_setopt($curl, CURLOPT_CAINFO, $this->cainfo); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); $response = curl_exec($curl); $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); $head = substr($response, 0, $headerSize); $body = substr($response, $headerSize); $responseHeaders = array(); $headerLines = preg_split("/\r?\n/", $head); foreach ($headerLines as $line) { if (!preg_match("/:/", $line)) continue; list($key, $value) = explode(':', $line, 2); $responseHeaders[trim($key)] = trim($value); } curl_close($curl); if (isset($buffer) && is_resource($buffer)) { fclose($buffer); } return new Response($statusCode, $body, $responseHeaders); } } ``` In this example, we are using some environment variables loaded at the program startup to retrieve various configuration settings: - Your Twilio Account Sid and Auth Token ([found here, in the Twilio console](https://console.twilio.com)) - A proxy address in IP:Port form, e.g. `127.0.0.1:8888` Place these setting in an `.env` file like so: ```env ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx AUTH_TOKEN= your_auth_token PROXY=127.0.0.1:8888 ``` Here’s the full console program that loads the `.env` file and sends a text message to show everything fitting together. ```php load(); use Twilio\Rest\Client; // Your Account Sid and Auth Token from twilio.com/console $sid = getenv('ACCOUNT_SID'); $token = getenv('AUTH_TOKEN'); $proxy = getenv('PROXY'); $httpClient = new MyRequestClass($proxy); $twilio = new Client($sid, $token, null, null, $httpClient); $message = $twilio->messages ->create( "+15558675310", array( 'body' => "Hey there!", 'from' => "+15017122661" ) ); print("Message SID: {$message->sid}"); ``` ## What else can this technique be used for? Now that you know how to inject your own httpClient into the Twilio API request pipeline, you could use this technique to add custom HTTP headers and authorization to the requests (perhaps as required by an upstream proxy server). You could also implement your own httpClient to mock the Twilio API responses so your unit and integration tests can run without the need to make a connection to Twilio. In fact, there’s already an example online showing [how to do exactly that with Node.js and Prism](https://www.twilio.com/docs/openapi/mock-api-generation-with-twilio-openapi-spec). We can’t wait to see what you build!