From 3ac1daba70f92e988eca4d9f022ef5f0d0b5e411 Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 26 Mar 2024 15:02:31 +0530 Subject: [PATCH 1/4] chore: provide application/json support in request body (#799) * fix: added support for json content type * chore: added static files for preview messaging * chore: corrected name casing * chore: upgrade guide and changelog updated * chore: updated rc in VersionInfo.php * chore: updated rc version --- CHANGES.md | 4 + UPGRADE.md | 5 + src/Twilio/Http/CurlClient.php | 6 +- src/Twilio/Rest/Client.php | 13 ++ src/Twilio/Rest/PreviewMessaging.php | 21 +++ src/Twilio/Rest/PreviewMessaging/V1.php | 105 +++++++++++ .../PreviewMessaging/V1/BroadcastInstance.php | 97 ++++++++++ .../PreviewMessaging/V1/BroadcastList.php | 83 +++++++++ .../PreviewMessaging/V1/BroadcastOptions.php | 85 +++++++++ .../PreviewMessaging/V1/BroadcastPage.php | 55 ++++++ .../PreviewMessaging/V1/MessageInstance.php | 95 ++++++++++ .../Rest/PreviewMessaging/V1/MessageList.php | 81 ++++++++ .../PreviewMessaging/V1/MessageModels.php | 174 ++++++++++++++++++ .../Rest/PreviewMessaging/V1/MessagePage.php | 55 ++++++ src/Twilio/Rest/PreviewMessagingBase.php | 88 +++++++++ src/Twilio/VersionInfo.php | 6 +- 16 files changed, 969 insertions(+), 4 deletions(-) create mode 100644 src/Twilio/Rest/PreviewMessaging.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1/BroadcastInstance.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1/BroadcastList.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1/BroadcastOptions.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1/BroadcastPage.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1/MessageInstance.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1/MessageList.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1/MessageModels.php create mode 100644 src/Twilio/Rest/PreviewMessaging/V1/MessagePage.php create mode 100644 src/Twilio/Rest/PreviewMessagingBase.php diff --git a/CHANGES.md b/CHANGES.md index fcf865d17..01687e257 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,10 @@ twilio-php Changelog ==================== +[2024-03-25] Version 8.0.0-rc.0 +--------------------------- +- Release Candidate Preparation + [2024-03-12] Version 7.16.1 --------------------------- **Api** diff --git a/UPGRADE.md b/UPGRADE.md index b68ac9617..10db9ef26 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -2,6 +2,11 @@ _MAJOR version bumps will have upgrade notes posted here._ +[2023-03-25] 7.x.x to 8.x.x-rc.x +--------------------------- +Twilio Php Helper Library’s major version 8.0.0-rc.x is now available. We ensured that you can upgrade to Php helper Library 8.0.0-rc.x version without any breaking changes +Twilio Helper libraries now support nested json body while sending requests. + [2023-03-08] 6.x.x to 7.x.x --------------------------- Twilio Php Helper Library’s major version 7.0.1 is now available. We ensured that you can upgrade to Php helper Library 7.0.1 version without any breaking changes. diff --git a/src/Twilio/Http/CurlClient.php b/src/Twilio/Http/CurlClient.php index 788cf23ca..95f1d5052 100644 --- a/src/Twilio/Http/CurlClient.php +++ b/src/Twilio/Http/CurlClient.php @@ -120,7 +120,11 @@ public function options(string $method, string $url, [$headers, $body] = $this->buildMultipartOptions($data); $options[CURLOPT_POSTFIELDS] = $body; $options[CURLOPT_HTTPHEADER] = \array_merge($options[CURLOPT_HTTPHEADER], $headers); - } else { + } + elseif (array_key_exists('Content-Type', $headers)) { + $options[CURLOPT_POSTFIELDS] = json_encode($data); + } + else { $options[CURLOPT_POSTFIELDS] = $this->buildQuery($data); $options[CURLOPT_HTTPHEADER][] = 'Content-Type: application/x-www-form-urlencoded'; } diff --git a/src/Twilio/Rest/Client.php b/src/Twilio/Rest/Client.php index 49ed6b00b..ad9a8039e 100644 --- a/src/Twilio/Rest/Client.php +++ b/src/Twilio/Rest/Client.php @@ -38,6 +38,7 @@ * @property Notify $notify * @property Numbers $numbers * @property Preview $preview + * @property PreviewMessaging $previewMessaging * @property Pricing $pricing * @property Proxy $proxy * @property Routes $routes @@ -116,6 +117,7 @@ class Client extends BaseClient { protected $_notify; protected $_numbers; protected $_preview; + protected $_previewMessaging; protected $_pricing; protected $_proxy; protected $_routes; @@ -351,6 +353,17 @@ protected function getPreview(): Preview { } return $this->_preview; } + /** + * Access the PreviewMessaging Twilio Domain + * + * @return PreviewMessaging PreviewMessaging Twilio Domain + */ + protected function getPreviewMessaging(): PreviewMessaging { + if (!$this->_previewMessaging) { + $this->_previewMessaging = new PreviewMessaging($this); + } + return $this->_previewMessaging; + } /** * Access the Pricing Twilio Domain * diff --git a/src/Twilio/Rest/PreviewMessaging.php b/src/Twilio/Rest/PreviewMessaging.php new file mode 100644 index 000000000..2fd257af8 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging.php @@ -0,0 +1,21 @@ +oauth instead. + */ + protected function getMessages(): \Twilio\Rest\PreviewMessaging\V1\MessageList { + return $this->v1->messages; + } + + /** + * @deprecated Use v1->oauth() instead. + */ + protected function getBroadcasts(): \Twilio\Rest\PreviewMessaging\V1\BroadcastList { + return $this->v1->broadcasts; + } +} diff --git a/src/Twilio/Rest/PreviewMessaging/V1.php b/src/Twilio/Rest/PreviewMessaging/V1.php new file mode 100644 index 000000000..91878c502 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1.php @@ -0,0 +1,105 @@ +version = 'v1'; + } + + protected function getBroadcasts(): BroadcastList + { + if (!$this->_broadcasts) { + $this->_broadcasts = new BroadcastList($this); + } + return $this->_broadcasts; + } + + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList($this); + } + return $this->_messages; + } + + /** + * 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.PreviewMessaging.V1]'; + } +} diff --git a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastInstance.php b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastInstance.php new file mode 100644 index 000000000..7882435c6 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastInstance.php @@ -0,0 +1,97 @@ +properties = [ + 'broadcastSid' => Values::array_get($payload, 'broadcast_sid'), + 'createdDate' => Deserialize::dateTime(Values::array_get($payload, 'created_date')), + 'updatedDate' => Deserialize::dateTime(Values::array_get($payload, 'updated_date')), + 'broadcastStatus' => Values::array_get($payload, 'broadcast_status'), + 'executionDetails' => Values::array_get($payload, 'execution_details'), + 'resultsFile' => Values::array_get($payload, 'results_file'), + ]; + + $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.PreviewMessaging.V1.BroadcastInstance]'; + } +} + diff --git a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastList.php b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastList.php new file mode 100644 index 000000000..650c7f4ca --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastList.php @@ -0,0 +1,83 @@ +solution = [ + ]; + + $this->uri = '/Broadcasts'; + } + + /** + * Create the BroadcastInstance + * + * @param array|Options $options Optional Arguments + * @return BroadcastInstance Created BroadcastInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): BroadcastInstance + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Request-Key' => $options['xTwilioRequestKey']]); + + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new BroadcastInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.PreviewMessaging.V1.BroadcastList]'; + } +} diff --git a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastOptions.php b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastOptions.php new file mode 100644 index 000000000..8eb35e034 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastOptions.php @@ -0,0 +1,85 @@ +options['xTwilioRequestKey'] = $xTwilioRequestKey; + } + + /** + * Idempotency key provided by the client + * + * @param string $xTwilioRequestKey Idempotency key provided by the client + * @return $this Fluent Builder + */ + public function setXTwilioRequestKey(string $xTwilioRequestKey): self + { + $this->options['xTwilioRequestKey'] = $xTwilioRequestKey; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.PreviewMessaging.V1.CreateBroadcastOptions ' . $options . ']'; + } +} + diff --git a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastPage.php b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastPage.php new file mode 100644 index 000000000..da20fadb1 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BroadcastInstance \Twilio\Rest\PreviewMessaging\V1\BroadcastInstance + */ + public function buildInstance(array $payload): BroadcastInstance + { + return new BroadcastInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.PreviewMessaging.V1.BroadcastPage]'; + } +} diff --git a/src/Twilio/Rest/PreviewMessaging/V1/MessageInstance.php b/src/Twilio/Rest/PreviewMessaging/V1/MessageInstance.php new file mode 100644 index 000000000..ed424ac86 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1/MessageInstance.php @@ -0,0 +1,95 @@ +properties = [ + 'totalMessageCount' => Values::array_get($payload, 'total_message_count'), + 'successCount' => Values::array_get($payload, 'success_count'), + 'errorCount' => Values::array_get($payload, 'error_count'), + 'messageReceipts' => Values::array_get($payload, 'message_receipts'), + 'failedMessageReceipts' => Values::array_get($payload, 'failed_message_receipts'), + ]; + + $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.PreviewMessaging.V1.MessageInstance]'; + } +} + diff --git a/src/Twilio/Rest/PreviewMessaging/V1/MessageList.php b/src/Twilio/Rest/PreviewMessaging/V1/MessageList.php new file mode 100644 index 000000000..83d982386 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1/MessageList.php @@ -0,0 +1,81 @@ +solution = [ + ]; + + $this->uri = '/Messages'; + } + + /** + * Create the MessageInstance + * + * @param CreateMessagesRequest $createMessagesRequest + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(CreateMessagesRequest $createMessagesRequest): MessageInstance + { + + $data = $createMessagesRequest->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.PreviewMessaging.V1.MessageList]'; + } +} diff --git a/src/Twilio/Rest/PreviewMessaging/V1/MessageModels.php b/src/Twilio/Rest/PreviewMessaging/V1/MessageModels.php new file mode 100644 index 000000000..77fbde1f3 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1/MessageModels.php @@ -0,0 +1,174 @@ + $contentVariables Key-value pairs of variable names to substitution values. Refer to the [Twilio Content API Resources](https://www.twilio.com/docs/content-api/content-api-resources#send-a-message-with-preconfigured-content) for more details. + */ + public static function createMessagingV1Message(array $payload = []): MessagingV1Message + { + return new MessagingV1Message($payload); + } + + /** + * @property MessagingV1Message[] $messages + * @property string $from A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. + * @property string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. + * @property string $body The text of the message you want to send. Can be up to 1,600 characters in length. + * @property string $contentSid The SID of the preconfigured [Content Template](https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided `ContentVariables`. This Twilio product is currently in Private Beta. + * @property string[] $mediaUrl The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. + * @property string $statusCallback The URL we should call using the \"status_callback_method\" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including \"MessageSid\", \"MessageStatus\", and \"ErrorCode\". If you include this parameter with the \"messaging_service_sid\", we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed. + * @property int $validityPeriod How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. + * @property string $sendAt The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format. + * @property string $scheduleType This parameter indicates your intent to schedule a message. Pass the value `fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter. + * @property bool $shortenUrls Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. + * @property bool $sendAsMms If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. + * @property string $maxPrice The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked. + * @property int $attempt Total number of attempts made ( including this ) to send out the message regardless of the provider used + * @property bool $smartEncoded This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false. + * @property bool $forceDelivery This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline. + * @property string $applicationSid The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application's message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application's message_status_callback parameter will be used. + */ + public static function createCreateMessagesRequest(array $payload = []): CreateMessagesRequest + { + return new CreateMessagesRequest($payload); + } + +} + +class MessagingV1Message implements \JsonSerializable +{ + /** + * @property string $to The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. + * @property string $body The text of the message you want to send. Can be up to 1,600 characters in length. Overrides the request-level body and content template if provided. + * @property array $contentVariables Key-value pairs of variable names to substitution values. Refer to the [Twilio Content API Resources](https://www.twilio.com/docs/content-api/content-api-resources#send-a-message-with-preconfigured-content) for more details. + */ + protected $to; + protected $body; + protected $contentVariables; + public function __construct(array $payload = []) { + $this->to = Values::array_get($payload, 'to'); + $this->body = Values::array_get($payload, 'body'); + $this->contentVariables = Values::array_get($payload, 'contentVariables'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'to' => $this->to, + 'body' => $this->body, + 'contentVariables' => $this->contentVariables + ]; + } +} + +class CreateMessagesRequest implements \JsonSerializable +{ + /** + * @property MessagingV1Message[] $messages + * @property string $from A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. + * @property string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. + * @property string $body The text of the message you want to send. Can be up to 1,600 characters in length. + * @property string $contentSid The SID of the preconfigured [Content Template](https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided `ContentVariables`. This Twilio product is currently in Private Beta. + * @property string[] $mediaUrl The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. + * @property string $statusCallback The URL we should call using the \"status_callback_method\" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including \"MessageSid\", \"MessageStatus\", and \"ErrorCode\". If you include this parameter with the \"messaging_service_sid\", we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed. + * @property int $validityPeriod How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. + * @property string $sendAt The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format. + * @property string $scheduleType This parameter indicates your intent to schedule a message. Pass the value `fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter. + * @property bool $shortenUrls Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. + * @property bool $sendAsMms If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. + * @property string $maxPrice The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked. + * @property int $attempt Total number of attempts made ( including this ) to send out the message regardless of the provider used + * @property bool $smartEncoded This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false. + * @property bool $forceDelivery This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline. + * @property string $applicationSid The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application's message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application's message_status_callback parameter will be used. + */ + protected $messages; + protected $from; + protected $messagingServiceSid; + protected $body; + protected $contentSid; + protected $mediaUrl; + protected $statusCallback; + protected $validityPeriod; + protected $sendAt; + protected $scheduleType; + protected $shortenUrls; + protected $sendAsMms; + protected $maxPrice; + protected $attempt; + protected $smartEncoded; + protected $forceDelivery; + protected $applicationSid; + public function __construct(array $payload = []) { + $this->messages = Values::array_get($payload, 'messages'); + $this->from = Values::array_get($payload, 'from'); + $this->messagingServiceSid = Values::array_get($payload, 'messagingServiceSid'); + $this->body = Values::array_get($payload, 'body'); + $this->contentSid = Values::array_get($payload, 'contentSid'); + $this->mediaUrl = Values::array_get($payload, 'mediaUrl'); + $this->statusCallback = Values::array_get($payload, 'statusCallback'); + $this->validityPeriod = Values::array_get($payload, 'validityPeriod'); + $this->sendAt = Values::array_get($payload, 'sendAt'); + $this->scheduleType = Values::array_get($payload, 'scheduleType'); + $this->shortenUrls = Values::array_get($payload, 'shortenUrls'); + $this->sendAsMms = Values::array_get($payload, 'sendAsMms'); + $this->maxPrice = Values::array_get($payload, 'maxPrice'); + $this->attempt = Values::array_get($payload, 'attempt'); + $this->smartEncoded = Values::array_get($payload, 'smartEncoded'); + $this->forceDelivery = Values::array_get($payload, 'forceDelivery'); + $this->applicationSid = Values::array_get($payload, 'applicationSid'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'messages' => $this->messages, + 'from' => $this->from, + 'messagingServiceSid' => $this->messagingServiceSid, + 'body' => $this->body, + 'contentSid' => $this->contentSid, + 'mediaUrl' => $this->mediaUrl, + 'statusCallback' => $this->statusCallback, + 'validityPeriod' => $this->validityPeriod, + 'sendAt' => $this->sendAt, + 'scheduleType' => $this->scheduleType, + 'shortenUrls' => $this->shortenUrls, + 'sendAsMms' => $this->sendAsMms, + 'maxPrice' => $this->maxPrice, + 'attempt' => $this->attempt, + 'smartEncoded' => $this->smartEncoded, + 'forceDelivery' => $this->forceDelivery, + 'applicationSid' => $this->applicationSid + ]; + } +} + diff --git a/src/Twilio/Rest/PreviewMessaging/V1/MessagePage.php b/src/Twilio/Rest/PreviewMessaging/V1/MessagePage.php new file mode 100644 index 000000000..f469bd583 --- /dev/null +++ b/src/Twilio/Rest/PreviewMessaging/V1/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\PreviewMessaging\V1\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.PreviewMessaging.V1.MessagePage]'; + } +} diff --git a/src/Twilio/Rest/PreviewMessagingBase.php b/src/Twilio/Rest/PreviewMessagingBase.php new file mode 100644 index 000000000..10588b31c --- /dev/null +++ b/src/Twilio/Rest/PreviewMessagingBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://preview.messaging.twilio.com'; + } + + + /** + * @return V1 Version v1 of PreviewMessaging + */ + 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.PreviewMessaging]'; + } +} diff --git a/src/Twilio/VersionInfo.php b/src/Twilio/VersionInfo.php index 80c0d17ff..d39ab56b1 100644 --- a/src/Twilio/VersionInfo.php +++ b/src/Twilio/VersionInfo.php @@ -5,9 +5,9 @@ class VersionInfo { - const MAJOR = "7"; - const MINOR = "16"; - const PATCH = "1"; + const MAJOR = "8"; + const MINOR = "0"; + const PATCH = "0-rc.0"; public static function string() { return implode('.', array(self::MAJOR, self::MINOR, self::PATCH)); From 5a5149b695441abddb8bf471cfc926875ac3a91c Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 1 Apr 2024 10:08:37 +0000 Subject: [PATCH 2/4] [Librarian] Regenerated @ 7e2caf2ef38bb07afedbc8ba24e3a235c57337ad 2deb312512e85217931fbc99141b334a5d6beaaf --- CHANGES.md | 41 + .../Accounts/V1/AuthTokenPromotionContext.php | 2 +- .../Accounts/V1/Credential/AwsContext.php | 2 +- .../V1/Credential/PublicKeyContext.php | 2 +- src/Twilio/Rest/Accounts/V1/SafelistList.php | 2 +- .../Accounts/V1/SecondaryAuthTokenContext.php | 2 +- .../Rest/Api/V2010/Account/AddressContext.php | 2 +- .../Api/V2010/Account/ApplicationContext.php | 2 +- .../Account/AuthorizedConnectAppContext.php | 2 +- .../AvailablePhoneNumberCountryContext.php | 2 +- .../Rest/Api/V2010/Account/BalanceList.php | 2 +- .../Account/Call/NotificationContext.php | 2 +- .../V2010/Account/Call/RecordingContext.php | 2 +- .../Rest/Api/V2010/Account/CallContext.php | 2 +- .../Rest/Api/V2010/Account/CallOptions.php | 48 +- .../Account/Conference/ParticipantContext.php | 2 +- .../Conference/ParticipantInstance.php | 2 + .../Account/Conference/RecordingContext.php | 2 +- .../Api/V2010/Account/ConferenceContext.php | 2 +- .../Api/V2010/Account/ConnectAppContext.php | 2 +- .../AssignedAddOnExtensionContext.php | 2 +- .../AssignedAddOnContext.php | 2 +- .../Account/IncomingPhoneNumberContext.php | 2 +- .../Rest/Api/V2010/Account/KeyContext.php | 2 +- .../V2010/Account/Message/MediaContext.php | 2 +- .../Rest/Api/V2010/Account/MessageContext.php | 2 +- .../Api/V2010/Account/NotificationContext.php | 2 +- .../V2010/Account/OutgoingCallerIdContext.php | 2 +- .../Api/V2010/Account/Queue/MemberContext.php | 2 +- .../Rest/Api/V2010/Account/QueueContext.php | 2 +- .../Recording/AddOnResult/PayloadContext.php | 2 +- .../Account/Recording/AddOnResultContext.php | 2 +- .../Recording/TranscriptionContext.php | 2 +- .../Api/V2010/Account/RecordingContext.php | 2 +- .../Api/V2010/Account/ShortCodeContext.php | 2 +- .../Api/V2010/Account/SigningKeyContext.php | 2 +- .../Sip/CredentialList/CredentialContext.php | 2 +- .../Account/Sip/CredentialListContext.php | 2 +- .../AuthCallsCredentialListMappingContext.php | 2 +- ...CallsIpAccessControlListMappingContext.php | 2 +- ...istrationsCredentialListMappingContext.php | 2 +- .../Domain/CredentialListMappingContext.php | 2 +- .../IpAccessControlListMappingContext.php | 2 +- .../Api/V2010/Account/Sip/DomainContext.php | 2 +- .../IpAccessControlList/IpAddressContext.php | 2 +- .../Sip/IpAccessControlListContext.php | 2 +- .../V2010/Account/TranscriptionContext.php | 2 +- .../V2010/Account/Usage/TriggerContext.php | 2 +- src/Twilio/Rest/Api/V2010/AccountContext.php | 2 +- .../Rest/Bulkexports/V1/Export/DayContext.php | 2 +- .../Rest/Bulkexports/V1/Export/JobContext.php | 2 +- .../V1/ExportConfigurationContext.php | 2 +- .../Rest/Bulkexports/V1/ExportContext.php | 2 +- src/Twilio/Rest/Chat/V1/CredentialContext.php | 2 +- .../Chat/V1/Service/Channel/InviteContext.php | 2 +- .../Chat/V1/Service/Channel/MemberContext.php | 2 +- .../V1/Service/Channel/MessageContext.php | 2 +- .../Rest/Chat/V1/Service/ChannelContext.php | 2 +- .../Rest/Chat/V1/Service/RoleContext.php | 2 +- .../Rest/Chat/V1/Service/UserContext.php | 2 +- src/Twilio/Rest/Chat/V1/ServiceContext.php | 2 +- src/Twilio/Rest/Chat/V2/CredentialContext.php | 2 +- .../Rest/Chat/V2/Service/BindingContext.php | 2 +- .../Chat/V2/Service/Channel/InviteContext.php | 2 +- .../Chat/V2/Service/Channel/MemberContext.php | 2 +- .../V2/Service/Channel/MessageContext.php | 2 +- .../V2/Service/Channel/WebhookContext.php | 2 +- .../Rest/Chat/V2/Service/ChannelContext.php | 2 +- .../Rest/Chat/V2/Service/RoleContext.php | 2 +- .../V2/Service/User/UserBindingContext.php | 2 +- .../V2/Service/User/UserChannelContext.php | 2 +- .../Rest/Chat/V2/Service/UserContext.php | 2 +- src/Twilio/Rest/Chat/V2/ServiceContext.php | 2 +- src/Twilio/Rest/Client.php | 42 +- .../V1/Content/ApprovalCreateInstance.php | 91 ++ .../Content/V1/Content/ApprovalCreateList.php | 80 ++ .../V1/Content/ApprovalCreateModels.php | 58 ++ .../Content/V1/Content/ApprovalCreatePage.php | 55 ++ .../V1/Content/ApprovalFetchContext.php | 14 +- .../V1/Content/ApprovalFetchInstance.php | 8 +- .../Content/V1/Content/ApprovalFetchList.php | 10 +- .../Content/V1/Content/ApprovalFetchPage.php | 2 +- src/Twilio/Rest/Content/V1/ContentContext.php | 20 +- .../Rest/Content/V1/ContentInstance.php | 10 + src/Twilio/Rest/Content/V1/ContentList.php | 22 + src/Twilio/Rest/Content/V1/ContentModels.php | 835 ++++++++++++++++++ .../V1/AddressConfigurationContext.php | 2 +- .../V1/Configuration/WebhookContext.php | 2 +- .../Conversations/V1/ConfigurationContext.php | 2 +- .../Message/DeliveryReceiptContext.php | 2 +- .../V1/Conversation/MessageContext.php | 2 +- .../V1/Conversation/ParticipantContext.php | 2 +- .../V1/Conversation/WebhookContext.php | 2 +- .../Conversations/V1/ConversationContext.php | 2 +- .../Conversations/V1/CredentialContext.php | 2 +- .../Rest/Conversations/V1/RoleContext.php | 2 +- .../V1/Service/BindingContext.php | 2 +- .../Configuration/NotificationContext.php | 2 +- .../Service/Configuration/WebhookContext.php | 2 +- .../V1/Service/ConfigurationContext.php | 2 +- .../Message/DeliveryReceiptContext.php | 2 +- .../Service/Conversation/MessageContext.php | 2 +- .../Conversation/ParticipantContext.php | 2 +- .../Service/Conversation/WebhookContext.php | 2 +- .../V1/Service/ConversationContext.php | 2 +- .../V1/Service/ConversationOptions.php | 16 +- .../Conversations/V1/Service/RoleContext.php | 2 +- .../Service/User/UserConversationContext.php | 2 +- .../Conversations/V1/Service/UserContext.php | 2 +- .../Rest/Conversations/V1/ServiceContext.php | 2 +- .../V1/User/UserConversationContext.php | 2 +- .../Rest/Conversations/V1/UserContext.php | 2 +- .../Rest/Events/V1/EventTypeContext.php | 2 +- .../Events/V1/Schema/SchemaVersionContext.php | 2 +- src/Twilio/Rest/Events/V1/SchemaContext.php | 2 +- .../Rest/Events/V1/Sink/SinkTestList.php | 2 +- src/Twilio/Rest/Events/V1/SinkContext.php | 2 +- .../Subscription/SubscribedEventContext.php | 2 +- .../Rest/Events/V1/SubscriptionContext.php | 2 +- src/Twilio/Rest/FlexApi/V1/ChannelContext.php | 2 +- .../Rest/FlexApi/V1/ConfigurationContext.php | 22 +- .../Rest/FlexApi/V1/ConfigurationInstance.php | 12 + .../Rest/FlexApi/V1/ConfigurationOptions.php | 2 + .../Rest/FlexApi/V1/FlexFlowContext.php | 2 +- .../Interaction/InteractionChannelContext.php | 2 +- .../Rest/FlexApi/V1/InteractionContext.php | 2 +- src/Twilio/Rest/FlexApi/V1/PluginList.php | 4 + src/Twilio/Rest/FlexApi/V1/PluginOptions.php | 36 + .../FlexApi/V1/ProvisioningStatusContext.php | 2 +- .../Rest/FlexApi/V1/WebChannelContext.php | 2 +- .../Rest/FrontlineApi/V1/UserContext.php | 2 +- .../Insights/V1/Call/AnnotationContext.php | 2 +- .../Insights/V1/Call/CallSummaryContext.php | 2 +- src/Twilio/Rest/Insights/V1/CallContext.php | 2 +- .../ConferenceParticipantContext.php | 2 +- .../Rest/Insights/V1/ConferenceContext.php | 2 +- .../Insights/V1/Room/ParticipantContext.php | 2 +- src/Twilio/Rest/Insights/V1/RoomContext.php | 2 +- .../Rest/Insights/V1/SettingContext.php | 2 +- .../Rest/Intelligence/V2/ServiceContext.php | 2 +- .../V2/Transcript/MediaContext.php | 2 +- .../V2/Transcript/OperatorResultContext.php | 2 +- .../Intelligence/V2/TranscriptContext.php | 2 +- .../Rest/IpMessaging/V1/CredentialContext.php | 2 +- .../V1/Service/Channel/InviteContext.php | 2 +- .../V1/Service/Channel/MemberContext.php | 2 +- .../V1/Service/Channel/MessageContext.php | 2 +- .../IpMessaging/V1/Service/ChannelContext.php | 2 +- .../IpMessaging/V1/Service/RoleContext.php | 2 +- .../IpMessaging/V1/Service/UserContext.php | 2 +- .../Rest/IpMessaging/V1/ServiceContext.php | 2 +- .../Rest/IpMessaging/V2/CredentialContext.php | 2 +- .../IpMessaging/V2/Service/BindingContext.php | 2 +- .../V2/Service/Channel/InviteContext.php | 2 +- .../V2/Service/Channel/MemberContext.php | 2 +- .../V2/Service/Channel/MessageContext.php | 2 +- .../V2/Service/Channel/WebhookContext.php | 2 +- .../IpMessaging/V2/Service/ChannelContext.php | 2 +- .../IpMessaging/V2/Service/RoleContext.php | 2 +- .../V2/Service/User/UserBindingContext.php | 2 +- .../V2/Service/User/UserChannelContext.php | 2 +- .../IpMessaging/V2/Service/UserContext.php | 2 +- .../Rest/IpMessaging/V2/ServiceContext.php | 2 +- .../Rest/Lookups/V1/PhoneNumberContext.php | 2 +- .../Rest/Lookups/V2/PhoneNumberContext.php | 2 +- .../Rest/Media/V1/MediaProcessorContext.php | 107 --- .../Rest/Media/V1/MediaProcessorInstance.php | 151 ---- .../Rest/Media/V1/MediaProcessorList.php | 210 ----- .../Rest/Media/V1/MediaProcessorOptions.php | 204 ----- .../Rest/Media/V1/MediaRecordingContext.php | 94 -- .../Rest/Media/V1/MediaRecordingInstance.php | 156 ---- .../Rest/Media/V1/MediaRecordingList.php | 174 ---- .../Rest/Media/V1/MediaRecordingOptions.php | 134 --- .../PlayerStreamer/PlaybackGrantInstance.php | 138 --- .../PlayerStreamer/PlaybackGrantOptions.php | 96 -- .../Rest/Media/V1/PlayerStreamerContext.php | 165 ---- .../Rest/Media/V1/PlayerStreamerInstance.php | 162 ---- .../Rest/Media/V1/PlayerStreamerList.php | 204 ----- .../Rest/Media/V1/PlayerStreamerOptions.php | 204 ----- .../BrandRegistrationOtpList.php | 2 +- .../BrandRegistration/BrandVettingContext.php | 2 +- .../Messaging/V1/BrandRegistrationContext.php | 4 +- .../Messaging/V1/DeactivationsContext.php | 2 +- .../Rest/Messaging/V1/DomainCertsContext.php | 2 +- .../Rest/Messaging/V1/DomainConfigContext.php | 2 +- .../DomainConfigMessagingServiceContext.php | 2 +- .../LinkshorteningMessagingServiceContext.php | 2 +- ...ssagingServiceDomainAssociationContext.php | 2 +- .../V1/Service/AlphaSenderContext.php | 2 +- .../V1/Service/ChannelSenderContext.php | 2 +- .../V1/Service/PhoneNumberContext.php | 2 +- .../Messaging/V1/Service/ShortCodeContext.php | 2 +- .../V1/Service/UsAppToPersonContext.php | 2 +- .../V1/Service/UsAppToPersonUsecaseList.php | 2 +- .../Rest/Messaging/V1/ServiceContext.php | 2 +- .../V1/TollfreeVerificationContext.php | 2 +- src/Twilio/Rest/Messaging/V1/UsecaseList.php | 2 +- .../Microvisor/V1/AccountConfigContext.php | 2 +- .../Microvisor/V1/AccountSecretContext.php | 2 +- .../Microvisor/V1/App/AppManifestContext.php | 2 +- src/Twilio/Rest/Microvisor/V1/AppContext.php | 2 +- .../V1/Device/DeviceConfigContext.php | 2 +- .../V1/Device/DeviceSecretContext.php | 2 +- .../Rest/Microvisor/V1/DeviceContext.php | 2 +- src/Twilio/Rest/Monitor/V1/AlertContext.php | 2 +- src/Twilio/Rest/Monitor/V1/EventContext.php | 2 +- .../Rest/Notify/V1/CredentialContext.php | 2 +- .../Rest/Notify/V1/Service/BindingContext.php | 2 +- src/Twilio/Rest/Notify/V1/ServiceContext.php | 2 +- src/Twilio/Rest/Numbers/V1.php | 22 + .../Numbers/V1/BulkEligibilityContext.php | 2 +- .../Rest/Numbers/V1/BulkEligibilityList.php | 23 + .../Rest/Numbers/V1/EligibilityInstance.php | 80 ++ .../V1/EligibilityList.php} | 39 +- .../V1/EligibilityPage.php} | 14 +- .../V1/PortingBulkPortabilityContext.php | 2 +- .../Numbers/V1/PortingPortInFetchContext.php | 2 +- .../Numbers/V1/PortingPortInFetchInstance.php | 2 + .../Rest/Numbers/V1/PortingPortInInstance.php | 82 ++ .../Rest/Numbers/V1/PortingPortInList.php | 72 ++ .../V1/PortingPortInPage.php} | 14 +- .../Numbers/V1/PortingPortabilityContext.php | 2 +- .../V2/AuthorizationDocumentContext.php | 2 +- .../V2/BulkHostedNumberOrderContext.php | 2 +- .../Numbers/V2/BulkHostedNumberOrderList.php | 23 + .../V2/BulkHostedNumberOrderOptions.php | 2 + .../Numbers/V2/HostedNumberOrderContext.php | 2 +- .../Bundle/EvaluationContext.php | 2 +- .../Bundle/EvaluationList.php | 2 +- .../Bundle/ItemAssignmentContext.php | 2 +- .../V2/RegulatoryCompliance/BundleContext.php | 2 +- .../RegulatoryCompliance/EndUserContext.php | 2 +- .../EndUserTypeContext.php | 2 +- .../RegulationContext.php | 2 +- .../SupportingDocumentContext.php | 2 +- .../SupportingDocumentTypeContext.php | 2 +- src/Twilio/Rest/{Media => Oauth}/V1.php | 50 +- .../Rest/Oauth/V1/AuthorizeInstance.php | 80 ++ src/Twilio/Rest/Oauth/V1/AuthorizeList.php | 88 ++ src/Twilio/Rest/Oauth/V1/AuthorizeOptions.php | 148 ++++ .../V1/AuthorizePage.php} | 14 +- src/Twilio/Rest/Oauth/V1/TokenInstance.php | 88 ++ src/Twilio/Rest/Oauth/V1/TokenList.php | 96 ++ src/Twilio/Rest/Oauth/V1/TokenOptions.php | 166 ++++ .../V1/TokenPage.php} | 14 +- .../Rest/{MediaBase.php => OauthBase.php} | 14 +- .../Fleet/CertificateContext.php | 2 +- .../Fleet/DeploymentContext.php | 2 +- .../DeployedDevices/Fleet/DeviceContext.php | 2 +- .../DeployedDevices/Fleet/KeyContext.php | 2 +- .../Preview/DeployedDevices/FleetContext.php | 2 +- .../AuthorizationDocumentContext.php | 2 +- .../HostedNumberOrderContext.php | 2 +- .../AvailableAddOnExtensionContext.php | 2 +- .../Marketplace/AvailableAddOnContext.php | 2 +- .../InstalledAddOnExtensionContext.php | 2 +- .../Marketplace/InstalledAddOnContext.php | 2 +- .../Document/DocumentPermissionContext.php | 2 +- .../Preview/Sync/Service/DocumentContext.php | 2 +- .../Service/SyncList/SyncListItemContext.php | 2 +- .../SyncList/SyncListPermissionContext.php | 2 +- .../Preview/Sync/Service/SyncListContext.php | 2 +- .../Service/SyncMap/SyncMapItemContext.php | 2 +- .../SyncMap/SyncMapPermissionContext.php | 2 +- .../Preview/Sync/Service/SyncMapContext.php | 2 +- .../Rest/Preview/Sync/ServiceContext.php | 2 +- .../Rest/Preview/Wireless/CommandContext.php | 2 +- .../Rest/Preview/Wireless/RatePlanContext.php | 2 +- .../Preview/Wireless/Sim/UsageContext.php | 2 +- .../Rest/Preview/Wireless/SimContext.php | 2 +- .../PreviewMessaging/V1/BroadcastInstance.php | 6 - .../PreviewMessaging/V1/BroadcastList.php | 6 - .../PreviewMessaging/V1/BroadcastOptions.php | 9 - .../PreviewMessaging/V1/MessageInstance.php | 7 - .../Rest/PreviewMessaging/V1/MessageList.php | 8 - src/Twilio/Rest/PreviewMessagingBase.php | 2 +- .../Pricing/V1/Messaging/CountryContext.php | 2 +- .../Pricing/V1/PhoneNumber/CountryContext.php | 2 +- .../Rest/Pricing/V1/Voice/CountryContext.php | 2 +- .../Rest/Pricing/V1/Voice/NumberContext.php | 2 +- src/Twilio/Rest/Pricing/V2/CountryContext.php | 2 +- src/Twilio/Rest/Pricing/V2/NumberContext.php | 2 +- .../Rest/Pricing/V2/Voice/CountryContext.php | 2 +- .../Rest/Pricing/V2/Voice/NumberContext.php | 2 +- .../Proxy/V1/Service/PhoneNumberContext.php | 2 +- .../V1/Service/Session/InteractionContext.php | 2 +- .../Participant/MessageInteractionContext.php | 2 +- .../V1/Service/Session/ParticipantContext.php | 2 +- .../Rest/Proxy/V1/Service/SessionContext.php | 2 +- .../Proxy/V1/Service/ShortCodeContext.php | 2 +- src/Twilio/Rest/Proxy/V1/ServiceContext.php | 2 +- .../Rest/Routes/V2/PhoneNumberContext.php | 2 +- .../Rest/Routes/V2/SipDomainContext.php | 2 +- src/Twilio/Rest/Routes/V2/TrunkContext.php | 2 +- .../V1/Service/Asset/AssetVersionContext.php | 2 +- .../Serverless/V1/Service/AssetContext.php | 2 +- .../V1/Service/Build/BuildStatusContext.php | 2 +- .../Serverless/V1/Service/BuildContext.php | 2 +- .../Service/Environment/DeploymentContext.php | 2 +- .../V1/Service/Environment/LogContext.php | 2 +- .../Service/Environment/VariableContext.php | 2 +- .../V1/Service/EnvironmentContext.php | 2 +- .../Serverless/V1/Service/FunctionContext.php | 2 +- .../FunctionVersionContentContext.php | 2 +- .../TwilioFunction/FunctionVersionContext.php | 2 +- .../Rest/Serverless/V1/ServiceContext.php | 2 +- .../Engagement/EngagementContextContext.php | 2 +- .../Engagement/Step/StepContextContext.php | 2 +- .../Studio/V1/Flow/Engagement/StepContext.php | 2 +- .../Rest/Studio/V1/Flow/EngagementContext.php | 2 +- .../Execution/ExecutionContextContext.php | 2 +- .../ExecutionStepContextContext.php | 2 +- .../Flow/Execution/ExecutionStepContext.php | 2 +- .../Rest/Studio/V1/Flow/ExecutionContext.php | 2 +- src/Twilio/Rest/Studio/V1/FlowContext.php | 2 +- .../Execution/ExecutionContextContext.php | 2 +- .../ExecutionStepContextContext.php | 2 +- .../Flow/Execution/ExecutionStepContext.php | 2 +- .../Rest/Studio/V2/Flow/ExecutionContext.php | 2 +- .../Studio/V2/Flow/FlowRevisionContext.php | 2 +- .../Studio/V2/Flow/FlowTestUserContext.php | 2 +- src/Twilio/Rest/Studio/V2/FlowContext.php | 2 +- .../Rest/Supersim/V1/EsimProfileContext.php | 2 +- src/Twilio/Rest/Supersim/V1/FleetContext.php | 2 +- .../Rest/Supersim/V1/IpCommandContext.php | 2 +- .../NetworkAccessProfileNetworkContext.php | 2 +- .../V1/NetworkAccessProfileContext.php | 2 +- .../Rest/Supersim/V1/NetworkContext.php | 2 +- src/Twilio/Rest/Supersim/V1/SimContext.php | 2 +- .../Rest/Supersim/V1/SmsCommandContext.php | 2 +- .../Document/DocumentPermissionContext.php | 2 +- .../Rest/Sync/V1/Service/DocumentContext.php | 2 +- .../Service/SyncList/SyncListItemContext.php | 2 +- .../SyncList/SyncListPermissionContext.php | 2 +- .../Rest/Sync/V1/Service/SyncListContext.php | 2 +- .../V1/Service/SyncMap/SyncMapItemContext.php | 2 +- .../SyncMap/SyncMapPermissionContext.php | 2 +- .../Rest/Sync/V1/Service/SyncMapContext.php | 2 +- .../Sync/V1/Service/SyncStreamContext.php | 2 +- src/Twilio/Rest/Sync/V1/ServiceContext.php | 2 +- .../V1/Workspace/ActivityContext.php | 2 +- .../Taskrouter/V1/Workspace/EventContext.php | 2 +- .../V1/Workspace/Task/ReservationContext.php | 2 +- .../V1/Workspace/TaskChannelContext.php | 2 +- .../Taskrouter/V1/Workspace/TaskContext.php | 2 +- ...askQueueBulkRealTimeStatisticsInstance.php | 89 ++ .../TaskQueueBulkRealTimeStatisticsList.php | 79 ++ .../TaskQueueBulkRealTimeStatisticsPage.php | 55 ++ .../TaskQueueCumulativeStatisticsContext.php | 2 +- .../TaskQueueRealTimeStatisticsContext.php | 2 +- .../TaskQueue/TaskQueueStatisticsContext.php | 2 +- .../V1/Workspace/TaskQueueContext.php | 2 +- .../Taskrouter/V1/Workspace/TaskQueueList.php | 26 +- .../Workspace/Worker/ReservationContext.php | 2 +- .../Workspace/Worker/WorkerChannelContext.php | 2 +- .../Worker/WorkerStatisticsContext.php | 2 +- .../WorkersCumulativeStatisticsContext.php | 2 +- .../WorkersRealTimeStatisticsContext.php | 2 +- .../Worker/WorkersStatisticsContext.php | 2 +- .../Taskrouter/V1/Workspace/WorkerContext.php | 2 +- .../WorkflowCumulativeStatisticsContext.php | 2 +- .../WorkflowRealTimeStatisticsContext.php | 2 +- .../Workflow/WorkflowStatisticsContext.php | 2 +- .../V1/Workspace/WorkflowContext.php | 2 +- .../WorkspaceCumulativeStatisticsContext.php | 2 +- .../WorkspaceRealTimeStatisticsContext.php | 2 +- .../Workspace/WorkspaceStatisticsContext.php | 2 +- .../Rest/Taskrouter/V1/WorkspaceContext.php | 2 +- .../V1/Trunk/CredentialListContext.php | 2 +- .../V1/Trunk/IpAccessControlListContext.php | 2 +- .../V1/Trunk/OriginationUrlContext.php | 2 +- .../Trunking/V1/Trunk/PhoneNumberContext.php | 2 +- .../Trunking/V1/Trunk/RecordingContext.php | 2 +- src/Twilio/Rest/Trunking/V1/TrunkContext.php | 2 +- ...omplianceRegistrationInquiriesContext.php} | 62 +- ...omplianceRegistrationInquiriesInstance.php | 43 +- .../ComplianceRegistrationInquiriesList.php | 18 + ...ComplianceRegistrationInquiriesOptions.php | 94 +- ...ofilesChannelEndpointAssignmentContext.php | 2 +- ...stomerProfilesEntityAssignmentsContext.php | 2 +- .../CustomerProfilesEntityAssignmentsList.php | 15 +- ...stomerProfilesEntityAssignmentsOptions.php | 82 ++ .../CustomerProfilesEvaluationsContext.php | 2 +- .../Trusthub/V1/CustomerProfilesContext.php | 2 +- .../Rest/Trusthub/V1/EndUserContext.php | 2 +- .../Rest/Trusthub/V1/EndUserTypeContext.php | 2 +- .../Rest/Trusthub/V1/PoliciesContext.php | 2 +- .../Trusthub/V1/SupportingDocumentContext.php | 2 +- .../V1/SupportingDocumentTypeContext.php | 2 +- ...oductsChannelEndpointAssignmentContext.php | 2 +- .../TrustProductsEntityAssignmentsContext.php | 2 +- .../TrustProductsEntityAssignmentsList.php | 15 +- .../TrustProductsEntityAssignmentsOptions.php | 82 ++ .../TrustProductsEvaluationsContext.php | 2 +- .../Rest/Trusthub/V1/TrustProductsContext.php | 4 +- .../Trusthub/V1/TrustProductsInstance.php | 2 +- .../Rest/Trusthub/V1/TrustProductsList.php | 6 +- .../Rest/Trusthub/V1/TrustProductsOptions.php | 24 +- src/Twilio/Rest/Verify/V2/FormContext.php | 2 +- src/Twilio/Rest/Verify/V2/SafelistContext.php | 2 +- .../Verify/V2/Service/AccessTokenContext.php | 2 +- .../V2/Service/Entity/ChallengeContext.php | 2 +- .../V2/Service/Entity/FactorContext.php | 2 +- .../Rest/Verify/V2/Service/EntityContext.php | 2 +- .../Service/MessagingConfigurationContext.php | 2 +- .../V2/Service/RateLimit/BucketContext.php | 2 +- .../Verify/V2/Service/RateLimitContext.php | 2 +- .../Verify/V2/Service/VerificationContext.php | 2 +- .../Rest/Verify/V2/Service/WebhookContext.php | 2 +- src/Twilio/Rest/Verify/V2/ServiceContext.php | 2 +- .../Verify/V2/VerificationAttemptContext.php | 2 +- .../V2/VerificationAttemptsSummaryContext.php | 2 +- .../Rest/Video/V1/CompositionContext.php | 2 +- .../Rest/Video/V1/CompositionHookContext.php | 2 +- .../Video/V1/CompositionSettingsContext.php | 2 +- src/Twilio/Rest/Video/V1/RecordingContext.php | 2 +- .../Video/V1/RecordingSettingsContext.php | 2 +- .../V1/Room/Participant/AnonymizeContext.php | 2 +- .../Participant/PublishedTrackContext.php | 2 +- .../Room/Participant/SubscribeRulesList.php | 2 +- .../Participant/SubscribedTrackContext.php | 2 +- .../Rest/Video/V1/Room/ParticipantContext.php | 2 +- .../Rest/Video/V1/Room/RecordingRulesList.php | 2 +- .../Video/V1/Room/RoomRecordingContext.php | 2 +- src/Twilio/Rest/Video/V1/RoomContext.php | 2 +- src/Twilio/Rest/Voice/V1/ByocTrunkContext.php | 2 +- .../ConnectionPolicyTargetContext.php | 2 +- .../Rest/Voice/V1/ConnectionPolicyContext.php | 2 +- .../V1/DialingPermissions/CountryContext.php | 2 +- .../V1/DialingPermissions/SettingsContext.php | 2 +- src/Twilio/Rest/Voice/V1/IpRecordContext.php | 2 +- .../Rest/Voice/V1/SourceIpMappingContext.php | 2 +- .../Rest/Wireless/V1/CommandContext.php | 2 +- .../Rest/Wireless/V1/RatePlanContext.php | 2 +- src/Twilio/Rest/Wireless/V1/SimContext.php | 2 +- 435 files changed, 3374 insertions(+), 2834 deletions(-) create mode 100644 src/Twilio/Rest/Content/V1/Content/ApprovalCreateInstance.php create mode 100644 src/Twilio/Rest/Content/V1/Content/ApprovalCreateList.php create mode 100644 src/Twilio/Rest/Content/V1/Content/ApprovalCreateModels.php create mode 100644 src/Twilio/Rest/Content/V1/Content/ApprovalCreatePage.php create mode 100644 src/Twilio/Rest/Content/V1/ContentModels.php delete mode 100644 src/Twilio/Rest/Media/V1/MediaProcessorContext.php delete mode 100644 src/Twilio/Rest/Media/V1/MediaProcessorInstance.php delete mode 100644 src/Twilio/Rest/Media/V1/MediaProcessorList.php delete mode 100644 src/Twilio/Rest/Media/V1/MediaProcessorOptions.php delete mode 100644 src/Twilio/Rest/Media/V1/MediaRecordingContext.php delete mode 100644 src/Twilio/Rest/Media/V1/MediaRecordingInstance.php delete mode 100644 src/Twilio/Rest/Media/V1/MediaRecordingList.php delete mode 100644 src/Twilio/Rest/Media/V1/MediaRecordingOptions.php delete mode 100644 src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantInstance.php delete mode 100644 src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantOptions.php delete mode 100644 src/Twilio/Rest/Media/V1/PlayerStreamerContext.php delete mode 100644 src/Twilio/Rest/Media/V1/PlayerStreamerInstance.php delete mode 100644 src/Twilio/Rest/Media/V1/PlayerStreamerList.php delete mode 100644 src/Twilio/Rest/Media/V1/PlayerStreamerOptions.php create mode 100644 src/Twilio/Rest/Numbers/V1/EligibilityInstance.php rename src/Twilio/Rest/{Media/V1/PlayerStreamer/PlaybackGrantList.php => Numbers/V1/EligibilityList.php} (57%) rename src/Twilio/Rest/{Media/V1/MediaProcessorPage.php => Numbers/V1/EligibilityPage.php} (76%) create mode 100644 src/Twilio/Rest/Numbers/V1/PortingPortInInstance.php create mode 100644 src/Twilio/Rest/Numbers/V1/PortingPortInList.php rename src/Twilio/Rest/{Media/V1/PlayerStreamer/PlaybackGrantPage.php => Numbers/V1/PortingPortInPage.php} (75%) rename src/Twilio/Rest/{Media => Oauth}/V1.php (60%) create mode 100644 src/Twilio/Rest/Oauth/V1/AuthorizeInstance.php create mode 100644 src/Twilio/Rest/Oauth/V1/AuthorizeList.php create mode 100644 src/Twilio/Rest/Oauth/V1/AuthorizeOptions.php rename src/Twilio/Rest/{Media/V1/PlayerStreamerPage.php => Oauth/V1/AuthorizePage.php} (76%) create mode 100644 src/Twilio/Rest/Oauth/V1/TokenInstance.php create mode 100644 src/Twilio/Rest/Oauth/V1/TokenList.php create mode 100644 src/Twilio/Rest/Oauth/V1/TokenOptions.php rename src/Twilio/Rest/{Media/V1/MediaRecordingPage.php => Oauth/V1/TokenPage.php} (76%) rename src/Twilio/Rest/{MediaBase.php => OauthBase.php} (89%) create mode 100644 src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsInstance.php create mode 100644 src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsList.php create mode 100644 src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsPage.php rename src/Twilio/Rest/{Media/V1/PlayerStreamer/PlaybackGrantContext.php => Trusthub/V1/ComplianceRegistrationInquiriesContext.php} (50%) create mode 100644 src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsOptions.php create mode 100644 src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsOptions.php diff --git a/CHANGES.md b/CHANGES.md index 01687e257..43011eb97 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,47 @@ twilio-php Changelog ==================== +[2024-04-01] Version 8.0.0-rc.1 +------------------------------- +**Library - Chore** +- [PR #799](https://github.com/twilio/twilio-php/pull/799): provide application/json support in request body. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Api** +- Add property `queue_time` to conference participant resource +- Update RiskCheck documentation +- Correct call filtering by start and end time documentation, clarifying that times are UTC. + +**Flex** +- Adding optional parameter to `plugins` + +**Media** +- Remove API: MediaProcessor + +**Messaging** +- Remove Sending-Window due to test failure +- Add Sending-Window as a response property to Messaging Services, gated by a beta feature flag + +**Numbers** +- Correct valid_until_date field to be visible in Bundles resource +- Adding port_in_status field to the Port In resource and phone_number_status and sid fields to the Port In Phone Number resource + +**Oauth** +- Modified token endpoint response +- Added refresh_token and scope as optional parameter to token endpoint +- Add new APIs for vendor authorize and token endpoints + +**Trusthub** +- Add update inquiry endpoint in compliance_registration. +- Add new field in themeSetId in compliance_registration. + +**Voice** +- Correct call filtering by start and end time documentation, clarifying that times are UTC. + +**Twiml** +- Add support for new Google voices (Q1 2024) for `Say` verb - gu-IN voices +- Add support for new Amazon Polly and Google voices (Q1 2024) for `Say` verb - Niamh (en-IE) and Sofie (da-DK) voices + + [2024-03-25] Version 8.0.0-rc.0 --------------------------- - Release Candidate Preparation diff --git a/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php b/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php index 203c95538..70283b4a9 100644 --- a/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php +++ b/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php @@ -50,7 +50,7 @@ public function __construct( public function update(): AuthTokenPromotionInstance { - $payload = $this->version->update('POST', $this->uri); + $payload = $this->version->update('POST', $this->uri, [], []); return new AuthTokenPromotionInstance( $this->version, diff --git a/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php b/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php index 0825eb9e4..044451fec 100644 --- a/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php +++ b/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php @@ -70,7 +70,7 @@ public function delete(): bool public function fetch(): AwsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AwsInstance( $this->version, diff --git a/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php b/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php index 3be90f2c7..6e616615c 100644 --- a/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php +++ b/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php @@ -70,7 +70,7 @@ public function delete(): bool public function fetch(): PublicKeyInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PublicKeyInstance( $this->version, diff --git a/src/Twilio/Rest/Accounts/V1/SafelistList.php b/src/Twilio/Rest/Accounts/V1/SafelistList.php index 6839afe7a..bbce3ad51 100644 --- a/src/Twilio/Rest/Accounts/V1/SafelistList.php +++ b/src/Twilio/Rest/Accounts/V1/SafelistList.php @@ -104,7 +104,7 @@ public function fetch(array $options = []): SafelistInstance $options['phoneNumber'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new SafelistInstance( $this->version, diff --git a/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php b/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php index 9fc1f7513..7523b0a14 100644 --- a/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php +++ b/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php @@ -50,7 +50,7 @@ public function __construct( public function create(): SecondaryAuthTokenInstance { - $payload = $this->version->create('POST', $this->uri); + $payload = $this->version->create('POST', $this->uri, [], []); return new SecondaryAuthTokenInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/AddressContext.php b/src/Twilio/Rest/Api/V2010/Account/AddressContext.php index 5ea3d7538..9c97ec7e8 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AddressContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/AddressContext.php @@ -83,7 +83,7 @@ public function delete(): bool public function fetch(): AddressInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AddressInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php b/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php index 9dffacd94..ee69d2afb 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): ApplicationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ApplicationInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php b/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php index e08f22e50..245f108c1 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): AuthorizedConnectAppInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthorizedConnectAppInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php index 1a9e05f8a..e07d85a45 100644 --- a/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php @@ -85,7 +85,7 @@ public function __construct( public function fetch(): AvailablePhoneNumberCountryInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AvailablePhoneNumberCountryInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/BalanceList.php b/src/Twilio/Rest/Api/V2010/Account/BalanceList.php index 49a2c14c7..979c74146 100644 --- a/src/Twilio/Rest/Api/V2010/Account/BalanceList.php +++ b/src/Twilio/Rest/Api/V2010/Account/BalanceList.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): BalanceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BalanceInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php b/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php index 6973439d1..215b73b32 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): NotificationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new NotificationInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php b/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php index 4e3531b9d..8dc54fb5b 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): RecordingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/CallContext.php b/src/Twilio/Rest/Api/V2010/Account/CallContext.php index 9e96a982a..74d99e4dc 100644 --- a/src/Twilio/Rest/Api/V2010/Account/CallContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/CallContext.php @@ -109,7 +109,7 @@ public function delete(): bool public function fetch(): CallInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CallInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/CallOptions.php b/src/Twilio/Rest/Api/V2010/Account/CallOptions.php index be85d3249..3be856a58 100644 --- a/src/Twilio/Rest/Api/V2010/Account/CallOptions.php +++ b/src/Twilio/Rest/Api/V2010/Account/CallOptions.php @@ -138,12 +138,12 @@ public static function create( * @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. + * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @return ReadCallOptions Options builder */ public static function read( @@ -742,12 +742,12 @@ class ReadCallOptions extends Options * @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. + * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ public function __construct( @@ -824,9 +824,9 @@ public function setStatus(string $status): self } /** - * 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. + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * - * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in 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 UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @return $this Fluent Builder */ public function setStartTimeBefore(string $startTimeBefore): self @@ -836,9 +836,9 @@ public function setStartTimeBefore(string $startTimeBefore): self } /** - * 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. + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * - * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in 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 UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @return $this Fluent Builder */ public function setStartTime(string $startTime): self @@ -848,9 +848,9 @@ public function setStartTime(string $startTime): self } /** - * 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. + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * - * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in 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 UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @return $this Fluent Builder */ public function setStartTimeAfter(string $startTimeAfter): self @@ -860,9 +860,9 @@ public function setStartTimeAfter(string $startTimeAfter): self } /** - * 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. + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * - * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in 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 UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @return $this Fluent Builder */ public function setEndTimeBefore(string $endTimeBefore): self @@ -872,9 +872,9 @@ public function setEndTimeBefore(string $endTimeBefore): self } /** - * 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. + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * - * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in 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 UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @return $this Fluent Builder */ public function setEndTime(string $endTime): self @@ -884,9 +884,9 @@ public function setEndTime(string $endTime): self } /** - * 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. + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * - * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in 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 UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @return $this Fluent Builder */ public function setEndTimeAfter(string $endTimeAfter): self diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php index 3c7da4b25..10b934f24 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php @@ -81,7 +81,7 @@ public function delete(): bool public function fetch(): ParticipantInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php index 567bf66e6..5227bfc84 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php @@ -39,6 +39,7 @@ * @property bool|null $hold * @property bool|null $startConferenceOnEnter * @property string $status + * @property string|null $queueTime * @property string|null $uri */ class ParticipantInstance extends InstanceResource @@ -71,6 +72,7 @@ public function __construct(Version $version, array $payload, string $accountSid 'hold' => Values::array_get($payload, 'hold'), 'startConferenceOnEnter' => Values::array_get($payload, 'start_conference_on_enter'), 'status' => Values::array_get($payload, 'status'), + 'queueTime' => Values::array_get($payload, 'queue_time'), 'uri' => Values::array_get($payload, 'uri'), ]; diff --git a/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php b/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php index 7f8af56cf..52a3f1f46 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): RecordingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php b/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php index e135552c2..409966610 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php @@ -74,7 +74,7 @@ public function __construct( public function fetch(): ConferenceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConferenceInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php b/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php index 70f079c3e..57f41c495 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): ConnectAppInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConnectAppInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php index 84792aa0c..a9dd22531 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php @@ -70,7 +70,7 @@ public function __construct( public function fetch(): AssignedAddOnExtensionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AssignedAddOnExtensionInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php index 2ad434156..d39f628c4 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): AssignedAddOnInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AssignedAddOnInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php index 24da22238..1103fbdbd 100644 --- a/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php @@ -84,7 +84,7 @@ public function delete(): bool public function fetch(): IncomingPhoneNumberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new IncomingPhoneNumberInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/KeyContext.php b/src/Twilio/Rest/Api/V2010/Account/KeyContext.php index 5bf32ce2b..5870addf3 100644 --- a/src/Twilio/Rest/Api/V2010/Account/KeyContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/KeyContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): KeyInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new KeyInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php b/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php index 29bf813ea..0dec14ae5 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): MediaInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MediaInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/MessageContext.php b/src/Twilio/Rest/Api/V2010/Account/MessageContext.php index 3f7d04cce..b635d357f 100644 --- a/src/Twilio/Rest/Api/V2010/Account/MessageContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/MessageContext.php @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): MessageInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php b/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php index ec6d68b87..aa2491955 100644 --- a/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): NotificationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new NotificationInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php b/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php index d9ae6de5b..4531bed0a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): OutgoingCallerIdInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new OutgoingCallerIdInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php b/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php index 7fdab4647..7670a4092 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php @@ -67,7 +67,7 @@ public function __construct( public function fetch(): MemberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/QueueContext.php b/src/Twilio/Rest/Api/V2010/Account/QueueContext.php index 5d92eb3c9..730f96a7d 100644 --- a/src/Twilio/Rest/Api/V2010/Account/QueueContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/QueueContext.php @@ -83,7 +83,7 @@ public function delete(): bool public function fetch(): QueueInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new QueueInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php index ecf60211a..121c4a60b 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php @@ -83,7 +83,7 @@ public function delete(): bool public function fetch(): PayloadInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PayloadInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php index 1d69695b2..923e5937f 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): AddOnResultInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AddOnResultInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php b/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php index 7cf979e0e..321438e76 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): TranscriptionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TranscriptionInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php b/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php index 3e6239547..fbee27c3a 100644 --- a/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php @@ -96,7 +96,7 @@ public function fetch(array $options = []): RecordingInstance Serialize::booleanToString($options['includeSoftDeleted']), ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new RecordingInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php b/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php index 8a363d390..772e6c4ed 100644 --- a/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php @@ -62,7 +62,7 @@ public function __construct( public function fetch(): ShortCodeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ShortCodeInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php b/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php index ae3cbc53a..aeeee4f03 100644 --- a/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): SigningKeyInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SigningKeyInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php index ebe77129d..31a67327e 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): CredentialInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php index b3db51b7e..c2d0870e4 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php @@ -82,7 +82,7 @@ public function delete(): bool public function fetch(): CredentialListInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialListInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php index b70929434..4f01b1a7c 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): AuthCallsCredentialListMappingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthCallsCredentialListMappingInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php index d6f61ea99..3e140bd82 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): AuthCallsIpAccessControlListMappingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthCallsIpAccessControlListMappingInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php index 3d03070fc..9e470a107 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): AuthRegistrationsCredentialListMappingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthRegistrationsCredentialListMappingInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php index f7ea9d423..25f9b1086 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): CredentialListMappingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialListMappingInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php index 23270db43..382e4ccf0 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): IpAccessControlListMappingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpAccessControlListMappingInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php index 68776a94b..d791824b1 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): DomainInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DomainInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php index 2f216c2fa..3e826e1bc 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): IpAddressInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpAddressInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php index 0473e4447..e1e035ffb 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php @@ -82,7 +82,7 @@ public function delete(): bool public function fetch(): IpAccessControlListInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpAccessControlListInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php b/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php index ecd107656..944904767 100644 --- a/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): TranscriptionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TranscriptionInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php b/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php index 010d6d0d6..bf0c1cee4 100644 --- a/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php +++ b/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): TriggerInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TriggerInstance( $this->version, diff --git a/src/Twilio/Rest/Api/V2010/AccountContext.php b/src/Twilio/Rest/Api/V2010/AccountContext.php index bcc34646e..b05e31054 100644 --- a/src/Twilio/Rest/Api/V2010/AccountContext.php +++ b/src/Twilio/Rest/Api/V2010/AccountContext.php @@ -150,7 +150,7 @@ public function __construct( public function fetch(): AccountInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AccountInstance( $this->version, diff --git a/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php b/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php index 6d39160c3..56004c57f 100644 --- a/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php +++ b/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): DayInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DayInstance( $this->version, diff --git a/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php b/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php index 73f81dbc3..42b2f7d84 100644 --- a/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php +++ b/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php @@ -68,7 +68,7 @@ public function delete(): bool public function fetch(): JobInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new JobInstance( $this->version, diff --git a/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php b/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php index 2b244772d..c514cb859 100644 --- a/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php +++ b/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php @@ -58,7 +58,7 @@ public function __construct( public function fetch(): ExportConfigurationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExportConfigurationInstance( $this->version, diff --git a/src/Twilio/Rest/Bulkexports/V1/ExportContext.php b/src/Twilio/Rest/Bulkexports/V1/ExportContext.php index 0a564b8b5..dfe17583f 100644 --- a/src/Twilio/Rest/Bulkexports/V1/ExportContext.php +++ b/src/Twilio/Rest/Bulkexports/V1/ExportContext.php @@ -66,7 +66,7 @@ public function __construct( public function fetch(): ExportInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExportInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V1/CredentialContext.php b/src/Twilio/Rest/Chat/V1/CredentialContext.php index cb77efeb1..6570f902e 100644 --- a/src/Twilio/Rest/Chat/V1/CredentialContext.php +++ b/src/Twilio/Rest/Chat/V1/CredentialContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): CredentialInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php b/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php index a63b79bed..15f51f971 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): InviteInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InviteInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php b/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php index d46f1a845..7a9583ec1 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): MemberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php b/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php index 16e9bf7cb..71aeec5c0 100644 --- a/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php +++ b/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): MessageInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php b/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php index 5f4ba32cb..4876dc0e5 100644 --- a/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php +++ b/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): ChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V1/Service/RoleContext.php b/src/Twilio/Rest/Chat/V1/Service/RoleContext.php index b30f7ed5c..a599f7789 100644 --- a/src/Twilio/Rest/Chat/V1/Service/RoleContext.php +++ b/src/Twilio/Rest/Chat/V1/Service/RoleContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): RoleInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V1/Service/UserContext.php b/src/Twilio/Rest/Chat/V1/Service/UserContext.php index 23a730192..953c74685 100644 --- a/src/Twilio/Rest/Chat/V1/Service/UserContext.php +++ b/src/Twilio/Rest/Chat/V1/Service/UserContext.php @@ -82,7 +82,7 @@ public function delete(): bool public function fetch(): UserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V1/ServiceContext.php b/src/Twilio/Rest/Chat/V1/ServiceContext.php index 84020be4f..3d18a7533 100644 --- a/src/Twilio/Rest/Chat/V1/ServiceContext.php +++ b/src/Twilio/Rest/Chat/V1/ServiceContext.php @@ -87,7 +87,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/CredentialContext.php b/src/Twilio/Rest/Chat/V2/CredentialContext.php index b3728e5de..7502e4fe1 100644 --- a/src/Twilio/Rest/Chat/V2/CredentialContext.php +++ b/src/Twilio/Rest/Chat/V2/CredentialContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): CredentialInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/BindingContext.php b/src/Twilio/Rest/Chat/V2/Service/BindingContext.php index 42723eb35..9f6a68630 100644 --- a/src/Twilio/Rest/Chat/V2/Service/BindingContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/BindingContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): BindingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BindingInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php b/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php index 7ae058d18..a5fbf6b5a 100644 --- a/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): InviteInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InviteInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php b/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php index 72adddb56..bf463ab05 100644 --- a/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): MemberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php b/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php index 0b9176e87..f954bfec1 100644 --- a/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): MessageInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php b/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php index 16196fbd9..cbc572bf4 100644 --- a/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php @@ -81,7 +81,7 @@ public function delete(): bool public function fetch(): WebhookInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php b/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php index 51d5eacfc..b25bbab79 100644 --- a/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php @@ -101,7 +101,7 @@ public function delete(array $options = []): bool public function fetch(): ChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/RoleContext.php b/src/Twilio/Rest/Chat/V2/Service/RoleContext.php index 1d621bc56..960fba813 100644 --- a/src/Twilio/Rest/Chat/V2/Service/RoleContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/RoleContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): RoleInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php b/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php index 5a471e46a..ee7b1ddfd 100644 --- a/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): UserBindingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserBindingInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php b/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php index 40e21fb87..8089a2ca3 100644 --- a/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): UserChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserChannelInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/Service/UserContext.php b/src/Twilio/Rest/Chat/V2/Service/UserContext.php index 2ee427053..8599823a9 100644 --- a/src/Twilio/Rest/Chat/V2/Service/UserContext.php +++ b/src/Twilio/Rest/Chat/V2/Service/UserContext.php @@ -87,7 +87,7 @@ public function delete(): bool public function fetch(): UserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, diff --git a/src/Twilio/Rest/Chat/V2/ServiceContext.php b/src/Twilio/Rest/Chat/V2/ServiceContext.php index 76ec9cdc2..c141f7d31 100644 --- a/src/Twilio/Rest/Chat/V2/ServiceContext.php +++ b/src/Twilio/Rest/Chat/V2/ServiceContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Client.php b/src/Twilio/Rest/Client.php index ad9a8039e..73ceeefc5 100644 --- a/src/Twilio/Rest/Client.php +++ b/src/Twilio/Rest/Client.php @@ -31,14 +31,14 @@ * @property Intelligence $intelligence * @property IpMessaging $ipMessaging * @property Lookups $lookups - * @property Media $media + * @property PreviewMessaging $previewMessaging * @property Messaging $messaging * @property Microvisor $microvisor * @property Monitor $monitor * @property Notify $notify * @property Numbers $numbers + * @property Oauth $oauth * @property Preview $preview - * @property PreviewMessaging $previewMessaging * @property Pricing $pricing * @property Proxy $proxy * @property Routes $routes @@ -110,14 +110,14 @@ class Client extends BaseClient { protected $_intelligence; protected $_ipMessaging; protected $_lookups; - protected $_media; + protected $_previewMessaging; protected $_messaging; protected $_microvisor; protected $_monitor; protected $_notify; protected $_numbers; + protected $_oauth; protected $_preview; - protected $_previewMessaging; protected $_pricing; protected $_proxy; protected $_routes; @@ -277,15 +277,15 @@ protected function getLookups(): Lookups { return $this->_lookups; } /** - * Access the Media Twilio Domain + * Access the PreviewMessaging Twilio Domain * - * @return Media Media Twilio Domain + * @return PreviewMessaging PreviewMessaging Twilio Domain */ - protected function getMedia(): Media { - if (!$this->_media) { - $this->_media = new Media($this); + protected function getPreviewMessaging(): PreviewMessaging { + if (!$this->_previewMessaging) { + $this->_previewMessaging = new PreviewMessaging($this); } - return $this->_media; + return $this->_previewMessaging; } /** * Access the Messaging Twilio Domain @@ -342,6 +342,17 @@ protected function getNumbers(): Numbers { } 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 * @@ -353,17 +364,6 @@ protected function getPreview(): Preview { } return $this->_preview; } - /** - * Access the PreviewMessaging Twilio Domain - * - * @return PreviewMessaging PreviewMessaging Twilio Domain - */ - protected function getPreviewMessaging(): PreviewMessaging { - if (!$this->_previewMessaging) { - $this->_previewMessaging = new PreviewMessaging($this); - } - return $this->_previewMessaging; - } /** * Access the Pricing Twilio Domain * diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateInstance.php b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateInstance.php new file mode 100644 index 000000000..5d5853979 --- /dev/null +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateInstance.php @@ -0,0 +1,91 @@ +properties = [ + 'name' => Values::array_get($payload, 'name'), + 'category' => Values::array_get($payload, 'category'), + 'contentType' => Values::array_get($payload, 'content_type'), + 'status' => Values::array_get($payload, 'status'), + 'rejectionReason' => Values::array_get($payload, 'rejection_reason'), + 'allowCategoryChange' => Values::array_get($payload, 'allow_category_change'), + ]; + + $this->solution = ['contentSid' => $contentSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalCreateInstance]'; + } +} + diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateList.php b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateList.php new file mode 100644 index 000000000..33f0d9a75 --- /dev/null +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateList.php @@ -0,0 +1,80 @@ +solution = [ + 'contentSid' => + $contentSid, + + ]; + + $this->uri = '/Content/' . \rawurlencode($contentSid) + .'/ApprovalRequests/whatsapp'; + } + + /** + * Create the ApprovalCreateInstance + * + * @param ContentApprovalRequest $contentApprovalRequest + * @return ApprovalCreateInstance Created ApprovalCreateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(ContentApprovalRequest $contentApprovalRequest): ApprovalCreateInstance + { + + $data = $contentApprovalRequest->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ApprovalCreateInstance( + $this->version, + $payload, + $this->solution['contentSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalCreateList]'; + } +} diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalCreateModels.php b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateModels.php new file mode 100644 index 000000000..c1581bb6a --- /dev/null +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalCreateModels.php @@ -0,0 +1,58 @@ +name = Values::array_get($payload, 'name'); + $this->category = Values::array_get($payload, 'category'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'name' => $this->name, + 'category' => $this->category + ]; + } +} + diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalCreatePage.php b/src/Twilio/Rest/Content/V1/Content/ApprovalCreatePage.php new file mode 100644 index 000000000..2e9085413 --- /dev/null +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalCreatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ApprovalCreateInstance \Twilio\Rest\Content\V1\Content\ApprovalCreateInstance + */ + public function buildInstance(array $payload): ApprovalCreateInstance + { + return new ApprovalCreateInstance($this->version, $payload, $this->solution['contentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalCreatePage]'; + } +} diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php index 2fadd77a1..44178edbb 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php @@ -28,21 +28,21 @@ class ApprovalFetchContext extends InstanceContext * Initialize the ApprovalFetchContext * * @param Version $version Version that contains the resource - * @param string $sid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + * @param string $contentSid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. */ public function __construct( Version $version, - $sid + $contentSid ) { parent::__construct($version); // Path Solution $this->solution = [ - 'sid' => - $sid, + 'contentSid' => + $contentSid, ]; - $this->uri = '/Content/' . \rawurlencode($sid) + $this->uri = '/Content/' . \rawurlencode($contentSid) .'/ApprovalRequests'; } @@ -55,12 +55,12 @@ public function __construct( public function fetch(): ApprovalFetchInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ApprovalFetchInstance( $this->version, $payload, - $this->solution['sid'] + $this->solution['contentSid'] ); } diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php index ee3d34d36..44a96fa28 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php @@ -36,9 +36,9 @@ class ApprovalFetchInstance extends InstanceResource * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload - * @param string $sid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + * @param string $contentSid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. */ - public function __construct(Version $version, array $payload, string $sid) + public function __construct(Version $version, array $payload, string $contentSid) { parent::__construct($version); @@ -50,7 +50,7 @@ public function __construct(Version $version, array $payload, string $sid) 'url' => Values::array_get($payload, 'url'), ]; - $this->solution = ['sid' => $sid, ]; + $this->solution = ['contentSid' => $contentSid, ]; } /** @@ -64,7 +64,7 @@ protected function proxy(): ApprovalFetchContext if (!$this->context) { $this->context = new ApprovalFetchContext( $this->version, - $this->solution['sid'] + $this->solution['contentSid'] ); } diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php index 9bb948a71..35301ef37 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php @@ -26,18 +26,18 @@ class ApprovalFetchList extends ListResource * Construct the ApprovalFetchList * * @param Version $version Version that contains the resource - * @param string $sid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + * @param string $contentSid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. */ public function __construct( Version $version, - string $sid + string $contentSid ) { parent::__construct($version); // Path Solution $this->solution = [ - 'sid' => - $sid, + 'contentSid' => + $contentSid, ]; } @@ -51,7 +51,7 @@ public function getContext( { return new ApprovalFetchContext( $this->version, - $this->solution['sid'] + $this->solution['contentSid'] ); } diff --git a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php index b205cd385..1bc0791e7 100644 --- a/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php +++ b/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php @@ -40,7 +40,7 @@ public function __construct(Version $version, Response $response, array $solutio */ public function buildInstance(array $payload): ApprovalFetchInstance { - return new ApprovalFetchInstance($this->version, $payload, $this->solution['sid']); + return new ApprovalFetchInstance($this->version, $payload, $this->solution['contentSid']); } /** diff --git a/src/Twilio/Rest/Content/V1/ContentContext.php b/src/Twilio/Rest/Content/V1/ContentContext.php index 7e62ba31e..f81387ed3 100644 --- a/src/Twilio/Rest/Content/V1/ContentContext.php +++ b/src/Twilio/Rest/Content/V1/ContentContext.php @@ -21,15 +21,18 @@ use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; +use Twilio\Rest\Content\V1\Content\ApprovalCreateList; use Twilio\Rest\Content\V1\Content\ApprovalFetchList; /** + * @property ApprovalCreateList $approvalCreate * @property ApprovalFetchList $approvalFetch * @method \Twilio\Rest\Content\V1\Content\ApprovalFetchContext approvalFetch() */ class ContentContext extends InstanceContext { + protected $_approvalCreate; protected $_approvalFetch; /** @@ -76,7 +79,7 @@ public function delete(): bool public function fetch(): ContentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ContentInstance( $this->version, @@ -86,6 +89,21 @@ public function fetch(): ContentInstance } + /** + * Access the approvalCreate + */ + protected function getApprovalCreate(): ApprovalCreateList + { + if (!$this->_approvalCreate) { + $this->_approvalCreate = new ApprovalCreateList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_approvalCreate; + } + /** * Access the approvalFetch */ diff --git a/src/Twilio/Rest/Content/V1/ContentInstance.php b/src/Twilio/Rest/Content/V1/ContentInstance.php index 49395d319..166c9b912 100644 --- a/src/Twilio/Rest/Content/V1/ContentInstance.php +++ b/src/Twilio/Rest/Content/V1/ContentInstance.php @@ -22,6 +22,7 @@ use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; +use Twilio\Rest\Content\V1\Content\ApprovalCreateList; use Twilio\Rest\Content\V1\Content\ApprovalFetchList; @@ -39,6 +40,7 @@ */ class ContentInstance extends InstanceResource { + protected $_approvalCreate; protected $_approvalFetch; /** @@ -111,6 +113,14 @@ public function fetch(): ContentInstance return $this->proxy()->fetch(); } + /** + * Access the approvalCreate + */ + protected function getApprovalCreate(): ApprovalCreateList + { + return $this->proxy()->approvalCreate; + } + /** * Access the approvalFetch */ diff --git a/src/Twilio/Rest/Content/V1/ContentList.php b/src/Twilio/Rest/Content/V1/ContentList.php index 6005e973e..6d611f1ad 100644 --- a/src/Twilio/Rest/Content/V1/ContentList.php +++ b/src/Twilio/Rest/Content/V1/ContentList.php @@ -16,6 +16,7 @@ namespace Twilio\Rest\Content\V1; +use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; @@ -41,6 +42,27 @@ public function __construct( $this->uri = '/Content'; } + /** + * Create the ContentInstance + * + * @param ContentCreateRequest $contentCreateRequest + * @return ContentInstance Created ContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(ContentCreateRequest $contentCreateRequest): ContentInstance + { + + $data = $contentCreateRequest->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ContentInstance( + $this->version, + $payload + ); + } + + /** * Reads ContentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into diff --git a/src/Twilio/Rest/Content/V1/ContentModels.php b/src/Twilio/Rest/Content/V1/ContentModels.php new file mode 100644 index 000000000..eee21de9e --- /dev/null +++ b/src/Twilio/Rest/Content/V1/ContentModels.php @@ -0,0 +1,835 @@ + $variables Key value pairs of variable name to value + * @property string $language Language code for the content + * @property Types $types + */ + public static function createContentCreateRequest(array $payload = []): ContentCreateRequest + { + return new ContentCreateRequest($payload); + } + +} + +class TwilioText implements \JsonSerializable +{ + /** + * @property string $body + */ + protected $body; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body + ]; + } +} + +class TwilioMedia implements \JsonSerializable +{ + /** + * @property string $body + * @property string[] $media + */ + protected $body; + protected $media; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->media = Values::array_get($payload, 'media'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'media' => $this->media + ]; + } +} + +class TwilioLocation implements \JsonSerializable +{ + /** + * @property string $latitude + * @property string $longitude + * @property string $label + */ + protected $latitude; + protected $longitude; + protected $label; + public function __construct(array $payload = []) { + $this->latitude = Values::array_get($payload, 'latitude'); + $this->longitude = Values::array_get($payload, 'longitude'); + $this->label = Values::array_get($payload, 'label'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'latitude' => $this->latitude, + 'longitude' => $this->longitude, + 'label' => $this->label + ]; + } +} + +class ListItem implements \JsonSerializable +{ + /** + * @property string $id + * @property string $item + * @property string $description + */ + protected $id; + protected $item; + protected $description; + public function __construct(array $payload = []) { + $this->id = Values::array_get($payload, 'id'); + $this->item = Values::array_get($payload, 'item'); + $this->description = Values::array_get($payload, 'description'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'id' => $this->id, + 'item' => $this->item, + 'description' => $this->description + ]; + } +} + +class TwilioListPicker implements \JsonSerializable +{ + /** + * @property string $body + * @property string $button + * @property ListItem[] $items + */ + protected $body; + protected $button; + protected $items; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->button = Values::array_get($payload, 'button'); + $this->items = Values::array_get($payload, 'items'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'button' => $this->button, + 'items' => $this->items + ]; + } +} + +class CallToActionAction implements \JsonSerializable +{ + /** + * @property string $type + * @property string $title + * @property string $url + * @property string $phone + * @property string $id + */ + protected $type; + protected $title; + protected $url; + protected $phone; + protected $id; + public function __construct(array $payload = []) { + $this->type = Values::array_get($payload, 'type'); + $this->title = Values::array_get($payload, 'title'); + $this->url = Values::array_get($payload, 'url'); + $this->phone = Values::array_get($payload, 'phone'); + $this->id = Values::array_get($payload, 'id'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'title' => $this->title, + 'url' => $this->url, + 'phone' => $this->phone, + 'id' => $this->id + ]; + } +} + +class TwilioCallToAction implements \JsonSerializable +{ + /** + * @property string $body + * @property CallToActionAction[] $actions + */ + protected $body; + protected $actions; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'actions' => $this->actions + ]; + } +} + +class QuickReplyAction implements \JsonSerializable +{ + /** + * @property string $type + * @property string $title + * @property string $id + */ + protected $type; + protected $title; + protected $id; + public function __construct(array $payload = []) { + $this->type = Values::array_get($payload, 'type'); + $this->title = Values::array_get($payload, 'title'); + $this->id = Values::array_get($payload, 'id'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'title' => $this->title, + 'id' => $this->id + ]; + } +} + +class TwilioQuickReply implements \JsonSerializable +{ + /** + * @property string $body + * @property QuickReplyAction[] $actions + */ + protected $body; + protected $actions; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'actions' => $this->actions + ]; + } +} + +class CardAction implements \JsonSerializable +{ + /** + * @property string $type + * @property string $title + * @property string $url + * @property string $phone + * @property string $id + */ + protected $type; + protected $title; + protected $url; + protected $phone; + protected $id; + public function __construct(array $payload = []) { + $this->type = Values::array_get($payload, 'type'); + $this->title = Values::array_get($payload, 'title'); + $this->url = Values::array_get($payload, 'url'); + $this->phone = Values::array_get($payload, 'phone'); + $this->id = Values::array_get($payload, 'id'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'title' => $this->title, + 'url' => $this->url, + 'phone' => $this->phone, + 'id' => $this->id + ]; + } +} + +class TwilioCard implements \JsonSerializable +{ + /** + * @property string $title + * @property string $subtitle + * @property string[] $media + * @property CardAction[] $actions + */ + protected $title; + protected $subtitle; + protected $media; + protected $actions; + public function __construct(array $payload = []) { + $this->title = Values::array_get($payload, 'title'); + $this->subtitle = Values::array_get($payload, 'subtitle'); + $this->media = Values::array_get($payload, 'media'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'title' => $this->title, + 'subtitle' => $this->subtitle, + 'media' => $this->media, + 'actions' => $this->actions + ]; + } +} + +class CatalogItem implements \JsonSerializable +{ + /** + * @property string $id + * @property string $sectionTitle + * @property string $name + * @property string $mediaUrl + * @property string $price + * @property string $description + */ + protected $id; + protected $sectionTitle; + protected $name; + protected $mediaUrl; + protected $price; + protected $description; + public function __construct(array $payload = []) { + $this->id = Values::array_get($payload, 'id'); + $this->sectionTitle = Values::array_get($payload, 'sectionTitle'); + $this->name = Values::array_get($payload, 'name'); + $this->mediaUrl = Values::array_get($payload, 'mediaUrl'); + $this->price = Values::array_get($payload, 'price'); + $this->description = Values::array_get($payload, 'description'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'id' => $this->id, + 'sectionTitle' => $this->sectionTitle, + 'name' => $this->name, + 'mediaUrl' => $this->mediaUrl, + 'price' => $this->price, + 'description' => $this->description + ]; + } +} + +class TwilioCatalog implements \JsonSerializable +{ + /** + * @property string $title + * @property string $body + * @property string $subtitle + * @property string $id + * @property CatalogItem[] $items + * @property string $dynamicItems + */ + protected $title; + protected $body; + protected $subtitle; + protected $id; + protected $items; + protected $dynamicItems; + public function __construct(array $payload = []) { + $this->title = Values::array_get($payload, 'title'); + $this->body = Values::array_get($payload, 'body'); + $this->subtitle = Values::array_get($payload, 'subtitle'); + $this->id = Values::array_get($payload, 'id'); + $this->items = Values::array_get($payload, 'items'); + $this->dynamicItems = Values::array_get($payload, 'dynamicItems'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'title' => $this->title, + 'body' => $this->body, + 'subtitle' => $this->subtitle, + 'id' => $this->id, + 'items' => $this->items, + 'dynamicItems' => $this->dynamicItems + ]; + } +} + +class WhatsappCard implements \JsonSerializable +{ + /** + * @property string $body + * @property string $footer + * @property string[] $media + * @property string $headerText + * @property CardAction[] $actions + */ + protected $body; + protected $footer; + protected $media; + protected $headerText; + protected $actions; + public function __construct(array $payload = []) { + $this->body = Values::array_get($payload, 'body'); + $this->footer = Values::array_get($payload, 'footer'); + $this->media = Values::array_get($payload, 'media'); + $this->headerText = Values::array_get($payload, 'headerText'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'body' => $this->body, + 'footer' => $this->footer, + 'media' => $this->media, + 'headerText' => $this->headerText, + 'actions' => $this->actions + ]; + } +} + +class AuthenticationAction implements \JsonSerializable +{ + /** + * @property string $type + * @property string $copyCodeText + */ + protected $type; + protected $copyCodeText; + public function __construct(array $payload = []) { + $this->type = Values::array_get($payload, 'type'); + $this->copyCodeText = Values::array_get($payload, 'copyCodeText'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'type' => $this->type, + 'copyCodeText' => $this->copyCodeText + ]; + } +} + +class WhatsappAuthentication implements \JsonSerializable +{ + /** + * @property bool $addSecurityRecommendation + * @property string $codeExpirationMinutes + * @property AuthenticationAction[] $actions + */ + protected $addSecurityRecommendation; + protected $codeExpirationMinutes; + protected $actions; + public function __construct(array $payload = []) { + $this->addSecurityRecommendation = Values::array_get($payload, 'addSecurityRecommendation'); + $this->codeExpirationMinutes = Values::array_get($payload, 'codeExpirationMinutes'); + $this->actions = Values::array_get($payload, 'actions'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'addSecurityRecommendation' => $this->addSecurityRecommendation, + 'codeExpirationMinutes' => $this->codeExpirationMinutes, + 'actions' => $this->actions + ]; + } +} + +class Types implements \JsonSerializable +{ + /** + * @property TwilioText $twilioText + * @property TwilioMedia $twilioMedia + * @property TwilioLocation $twilioLocation + * @property TwilioListPicker $twilioListPicker + * @property TwilioCallToAction $twilioCallToAction + * @property TwilioQuickReply $twilioQuickReply + * @property TwilioCard $twilioCard + * @property TwilioCatalog $twilioCatalog + * @property WhatsappCard $whatsappCard + * @property WhatsappAuthentication $whatsappAuthentication + */ + protected $twilioText; + protected $twilioMedia; + protected $twilioLocation; + protected $twilioListPicker; + protected $twilioCallToAction; + protected $twilioQuickReply; + protected $twilioCard; + protected $twilioCatalog; + protected $whatsappCard; + protected $whatsappAuthentication; + public function __construct(array $payload = []) { + $this->twilioText = Values::array_get($payload, 'twilioText'); + $this->twilioMedia = Values::array_get($payload, 'twilioMedia'); + $this->twilioLocation = Values::array_get($payload, 'twilioLocation'); + $this->twilioListPicker = Values::array_get($payload, 'twilioListPicker'); + $this->twilioCallToAction = Values::array_get($payload, 'twilioCallToAction'); + $this->twilioQuickReply = Values::array_get($payload, 'twilioQuickReply'); + $this->twilioCard = Values::array_get($payload, 'twilioCard'); + $this->twilioCatalog = Values::array_get($payload, 'twilioCatalog'); + $this->whatsappCard = Values::array_get($payload, 'whatsappCard'); + $this->whatsappAuthentication = Values::array_get($payload, 'whatsappAuthentication'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'twilioText' => $this->twilioText, + 'twilioMedia' => $this->twilioMedia, + 'twilioLocation' => $this->twilioLocation, + 'twilioListPicker' => $this->twilioListPicker, + 'twilioCallToAction' => $this->twilioCallToAction, + 'twilioQuickReply' => $this->twilioQuickReply, + 'twilioCard' => $this->twilioCard, + 'twilioCatalog' => $this->twilioCatalog, + 'whatsappCard' => $this->whatsappCard, + 'whatsappAuthentication' => $this->whatsappAuthentication + ]; + } +} + +class ContentCreateRequest implements \JsonSerializable +{ + /** + * @property string $friendlyName User defined name of the content + * @property array $variables Key value pairs of variable name to value + * @property string $language Language code for the content + * @property Types $types + */ + protected $friendlyName; + protected $variables; + protected $language; + protected $types; + public function __construct(array $payload = []) { + $this->friendlyName = Values::array_get($payload, 'friendlyName'); + $this->variables = Values::array_get($payload, 'variables'); + $this->language = Values::array_get($payload, 'language'); + $this->types = Values::array_get($payload, 'types'); + } + + public function toArray(): array + { + return $this->jsonSerialize(); + } + + public function jsonSerialize(): array + { + return [ + 'friendlyName' => $this->friendlyName, + 'variables' => $this->variables, + 'language' => $this->language, + 'types' => $this->types + ]; + } +} + diff --git a/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php b/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php index 5fc77b9cf..9c2d14a54 100644 --- a/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php +++ b/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): AddressConfigurationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AddressConfigurationInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php b/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php index c488b5cc0..3714d8012 100644 --- a/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php +++ b/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php @@ -53,7 +53,7 @@ public function __construct( public function fetch(): WebhookInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php b/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php index 1b1ab3121..fc8373c43 100644 --- a/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php +++ b/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php @@ -52,7 +52,7 @@ public function __construct( public function fetch(): ConfigurationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConfigurationInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php b/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php index 19a0b0276..2e25903c8 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php +++ b/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): DeliveryReceiptInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeliveryReceiptInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php b/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php index 60bbe323a..2b22b2fc7 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php +++ b/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php @@ -89,7 +89,7 @@ public function delete(array $options = []): bool public function fetch(): MessageInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php b/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php index c6c8e0c5a..f227c2632 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php +++ b/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php @@ -81,7 +81,7 @@ public function delete(array $options = []): bool public function fetch(): ParticipantInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php b/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php index c3a791851..5aa91447e 100644 --- a/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php +++ b/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): WebhookInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/ConversationContext.php b/src/Twilio/Rest/Conversations/V1/ConversationContext.php index 5f34169a7..fbb5d896c 100644 --- a/src/Twilio/Rest/Conversations/V1/ConversationContext.php +++ b/src/Twilio/Rest/Conversations/V1/ConversationContext.php @@ -92,7 +92,7 @@ public function delete(array $options = []): bool public function fetch(): ConversationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConversationInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/CredentialContext.php b/src/Twilio/Rest/Conversations/V1/CredentialContext.php index f6ff1addd..3f77bc3e1 100644 --- a/src/Twilio/Rest/Conversations/V1/CredentialContext.php +++ b/src/Twilio/Rest/Conversations/V1/CredentialContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): CredentialInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/RoleContext.php b/src/Twilio/Rest/Conversations/V1/RoleContext.php index d3d269b5d..c9e1ad66c 100644 --- a/src/Twilio/Rest/Conversations/V1/RoleContext.php +++ b/src/Twilio/Rest/Conversations/V1/RoleContext.php @@ -70,7 +70,7 @@ public function delete(): bool public function fetch(): RoleInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php b/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php index 6b92ca7cb..48b0f4d14 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): BindingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BindingInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php b/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php index 97c2fa55b..fc86956d9 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php @@ -58,7 +58,7 @@ public function __construct( public function fetch(): NotificationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new NotificationInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php b/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php index 0c3927ffc..520e20ce4 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php @@ -58,7 +58,7 @@ public function __construct( public function fetch(): WebhookInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php b/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php index 4e20e98e7..e0f159370 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php @@ -58,7 +58,7 @@ public function __construct( public function fetch(): ConfigurationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConfigurationInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php b/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php index 3e8fe005b..88a4bc9c3 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php @@ -70,7 +70,7 @@ public function __construct( public function fetch(): DeliveryReceiptInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeliveryReceiptInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php b/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php index 1e499d280..f72a63108 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php @@ -94,7 +94,7 @@ public function delete(array $options = []): bool public function fetch(): MessageInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php b/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php index 8349decea..229c9915e 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): ParticipantInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php b/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php index 715f1bd84..d1d925712 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php @@ -81,7 +81,7 @@ public function delete(): bool public function fetch(): WebhookInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php b/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php index 5b7497162..00ba74758 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php @@ -97,7 +97,7 @@ public function delete(array $options = []): bool public function fetch(): ConversationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConversationInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php b/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php index 379ed1716..62306ba9a 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php +++ b/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php @@ -85,8 +85,8 @@ public static function delete( /** - * @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 $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * @return ReadConversationOptions Options builder */ @@ -396,8 +396,8 @@ public function __toString(): string 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 $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ public function __construct( @@ -413,9 +413,9 @@ public function __construct( } /** - * 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. + * Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * - * @param string $startDate 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 Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @return $this Fluent Builder */ public function setStartDate(string $startDate): self @@ -425,9 +425,9 @@ public function setStartDate(string $startDate): self } /** - * 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. + * Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * - * @param string $endDate 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 Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @return $this Fluent Builder */ public function setEndDate(string $endDate): self diff --git a/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php b/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php index fe406e884..850166a54 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): RoleInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php b/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php index 31dcae749..8a78d2ac6 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php @@ -81,7 +81,7 @@ public function delete(): bool public function fetch(): UserConversationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserConversationInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/Service/UserContext.php b/src/Twilio/Rest/Conversations/V1/Service/UserContext.php index ef6126bb3..d698a6cd7 100644 --- a/src/Twilio/Rest/Conversations/V1/Service/UserContext.php +++ b/src/Twilio/Rest/Conversations/V1/Service/UserContext.php @@ -88,7 +88,7 @@ public function delete(array $options = []): bool public function fetch(): UserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/ServiceContext.php b/src/Twilio/Rest/Conversations/V1/ServiceContext.php index dfbb9a2f0..a4cf19586 100644 --- a/src/Twilio/Rest/Conversations/V1/ServiceContext.php +++ b/src/Twilio/Rest/Conversations/V1/ServiceContext.php @@ -95,7 +95,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php b/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php index 219f30570..d513ab153 100644 --- a/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php +++ b/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): UserConversationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserConversationInstance( $this->version, diff --git a/src/Twilio/Rest/Conversations/V1/UserContext.php b/src/Twilio/Rest/Conversations/V1/UserContext.php index 2fa8c41ca..f53718fb8 100644 --- a/src/Twilio/Rest/Conversations/V1/UserContext.php +++ b/src/Twilio/Rest/Conversations/V1/UserContext.php @@ -83,7 +83,7 @@ public function delete(array $options = []): bool public function fetch(): UserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, diff --git a/src/Twilio/Rest/Events/V1/EventTypeContext.php b/src/Twilio/Rest/Events/V1/EventTypeContext.php index ef1eeb0b9..65591943f 100644 --- a/src/Twilio/Rest/Events/V1/EventTypeContext.php +++ b/src/Twilio/Rest/Events/V1/EventTypeContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): EventTypeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EventTypeInstance( $this->version, diff --git a/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php b/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php index 84425a6bb..5470b62db 100644 --- a/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php +++ b/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): SchemaVersionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SchemaVersionInstance( $this->version, diff --git a/src/Twilio/Rest/Events/V1/SchemaContext.php b/src/Twilio/Rest/Events/V1/SchemaContext.php index f23ddf390..240c4b271 100644 --- a/src/Twilio/Rest/Events/V1/SchemaContext.php +++ b/src/Twilio/Rest/Events/V1/SchemaContext.php @@ -63,7 +63,7 @@ public function __construct( public function fetch(): SchemaInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SchemaInstance( $this->version, diff --git a/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php b/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php index 9b698b98e..012cbdc51 100644 --- a/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php +++ b/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php @@ -55,7 +55,7 @@ public function __construct( public function create(): SinkTestInstance { - $payload = $this->version->create('POST', $this->uri); + $payload = $this->version->create('POST', $this->uri, [], []); return new SinkTestInstance( $this->version, diff --git a/src/Twilio/Rest/Events/V1/SinkContext.php b/src/Twilio/Rest/Events/V1/SinkContext.php index a77877d6b..d693d9feb 100644 --- a/src/Twilio/Rest/Events/V1/SinkContext.php +++ b/src/Twilio/Rest/Events/V1/SinkContext.php @@ -79,7 +79,7 @@ public function delete(): bool public function fetch(): SinkInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SinkInstance( $this->version, diff --git a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php index 8d7d61b8c..d08f23285 100644 --- a/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php +++ b/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): SubscribedEventInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SubscribedEventInstance( $this->version, diff --git a/src/Twilio/Rest/Events/V1/SubscriptionContext.php b/src/Twilio/Rest/Events/V1/SubscriptionContext.php index 6cc98e539..bd7eca694 100644 --- a/src/Twilio/Rest/Events/V1/SubscriptionContext.php +++ b/src/Twilio/Rest/Events/V1/SubscriptionContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): SubscriptionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SubscriptionInstance( $this->version, diff --git a/src/Twilio/Rest/FlexApi/V1/ChannelContext.php b/src/Twilio/Rest/FlexApi/V1/ChannelContext.php index a7c34e452..9747d1e52 100644 --- a/src/Twilio/Rest/FlexApi/V1/ChannelContext.php +++ b/src/Twilio/Rest/FlexApi/V1/ChannelContext.php @@ -68,7 +68,7 @@ public function delete(): bool public function fetch(): ChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, diff --git a/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php b/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php index c4ed9031f..1412b913c 100644 --- a/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php +++ b/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php @@ -60,7 +60,27 @@ public function fetch(array $options = []): ConfigurationInstance $options['uiVersion'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); + + return new ConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Update the ConfigurationInstance + * + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): ConfigurationInstance + { + + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ConfigurationInstance( $this->version, diff --git a/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php b/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php index aeb3e2754..27b6747d9 100644 --- a/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php +++ b/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php @@ -174,6 +174,18 @@ public function fetch(array $options = []): ConfigurationInstance return $this->proxy()->fetch($options); } + /** + * Update the ConfigurationInstance + * + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): ConfigurationInstance + { + + return $this->proxy()->update(); + } + /** * Magic getter to access properties * diff --git a/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php b/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php index b48d0364c..48530ff51 100644 --- a/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php +++ b/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php @@ -35,6 +35,7 @@ public static function fetch( ); } + } class FetchConfigurationOptions extends Options @@ -74,3 +75,4 @@ public function __toString(): string } } + diff --git a/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php b/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php index 726cfab35..be10778c3 100644 --- a/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php +++ b/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): FlexFlowInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlexFlowInstance( $this->version, diff --git a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php index 74531cd6d..e3e47c3b7 100644 --- a/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php +++ b/src/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php @@ -74,7 +74,7 @@ public function __construct( public function fetch(): InteractionChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InteractionChannelInstance( $this->version, diff --git a/src/Twilio/Rest/FlexApi/V1/InteractionContext.php b/src/Twilio/Rest/FlexApi/V1/InteractionContext.php index ecb9a2170..11a23ca7a 100644 --- a/src/Twilio/Rest/FlexApi/V1/InteractionContext.php +++ b/src/Twilio/Rest/FlexApi/V1/InteractionContext.php @@ -63,7 +63,7 @@ public function __construct( public function fetch(): InteractionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InteractionInstance( $this->version, diff --git a/src/Twilio/Rest/FlexApi/V1/PluginList.php b/src/Twilio/Rest/FlexApi/V1/PluginList.php index 5fcf0e729..9974df26d 100644 --- a/src/Twilio/Rest/FlexApi/V1/PluginList.php +++ b/src/Twilio/Rest/FlexApi/V1/PluginList.php @@ -63,6 +63,10 @@ public function create(string $uniqueName, array $options = []): PluginInstance $options['friendlyName'], 'Description' => $options['description'], + 'CliVersion' => + $options['cliVersion'], + 'ValidateStatus' => + $options['validateStatus'], ]); $headers = Values::of(['Flex-Metadata' => $options['flexMetadata']]); diff --git a/src/Twilio/Rest/FlexApi/V1/PluginOptions.php b/src/Twilio/Rest/FlexApi/V1/PluginOptions.php index 8f88677b2..f9f7a27fe 100644 --- a/src/Twilio/Rest/FlexApi/V1/PluginOptions.php +++ b/src/Twilio/Rest/FlexApi/V1/PluginOptions.php @@ -23,6 +23,8 @@ abstract class PluginOptions /** * @param string $friendlyName The Flex Plugin's friendly name. * @param string $description A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + * @param string $cliVersion The version of Flex Plugins CLI used to create this plugin + * @param string $validateStatus The validation status of the plugin, indicating whether it has been validated * @param string $flexMetadata The Flex-Metadata HTTP request header * @return CreatePluginOptions Options builder */ @@ -30,6 +32,8 @@ public static function create( string $friendlyName = Values::NONE, string $description = Values::NONE, + string $cliVersion = Values::NONE, + string $validateStatus = Values::NONE, string $flexMetadata = Values::NONE ): CreatePluginOptions @@ -37,6 +41,8 @@ public static function create( return new CreatePluginOptions( $friendlyName, $description, + $cliVersion, + $validateStatus, $flexMetadata ); } @@ -99,17 +105,23 @@ class CreatePluginOptions extends Options /** * @param string $friendlyName The Flex Plugin's friendly name. * @param string $description A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + * @param string $cliVersion The version of Flex Plugins CLI used to create this plugin + * @param string $validateStatus The validation status of the plugin, indicating whether it has been validated * @param string $flexMetadata The Flex-Metadata HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $description = Values::NONE, + string $cliVersion = Values::NONE, + string $validateStatus = Values::NONE, string $flexMetadata = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['description'] = $description; + $this->options['cliVersion'] = $cliVersion; + $this->options['validateStatus'] = $validateStatus; $this->options['flexMetadata'] = $flexMetadata; } @@ -137,6 +149,30 @@ public function setDescription(string $description): self return $this; } + /** + * The version of Flex Plugins CLI used to create this plugin + * + * @param string $cliVersion The version of Flex Plugins CLI used to create this plugin + * @return $this Fluent Builder + */ + public function setCliVersion(string $cliVersion): self + { + $this->options['cliVersion'] = $cliVersion; + return $this; + } + + /** + * The validation status of the plugin, indicating whether it has been validated + * + * @param string $validateStatus The validation status of the plugin, indicating whether it has been validated + * @return $this Fluent Builder + */ + public function setValidateStatus(string $validateStatus): self + { + $this->options['validateStatus'] = $validateStatus; + return $this; + } + /** * The Flex-Metadata HTTP request header * diff --git a/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusContext.php b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusContext.php index 567b44d92..9f172fba0 100644 --- a/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusContext.php +++ b/src/Twilio/Rest/FlexApi/V1/ProvisioningStatusContext.php @@ -50,7 +50,7 @@ public function __construct( public function fetch(): ProvisioningStatusInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ProvisioningStatusInstance( $this->version, diff --git a/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php b/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php index 84aad9aed..110035328 100644 --- a/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php +++ b/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php @@ -70,7 +70,7 @@ public function delete(): bool public function fetch(): WebChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebChannelInstance( $this->version, diff --git a/src/Twilio/Rest/FrontlineApi/V1/UserContext.php b/src/Twilio/Rest/FrontlineApi/V1/UserContext.php index 9a823bc87..0cd7b784c 100644 --- a/src/Twilio/Rest/FrontlineApi/V1/UserContext.php +++ b/src/Twilio/Rest/FrontlineApi/V1/UserContext.php @@ -58,7 +58,7 @@ public function __construct( public function fetch(): UserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, diff --git a/src/Twilio/Rest/Insights/V1/Call/AnnotationContext.php b/src/Twilio/Rest/Insights/V1/Call/AnnotationContext.php index 6a562c8d4..8ceaa7f3c 100644 --- a/src/Twilio/Rest/Insights/V1/Call/AnnotationContext.php +++ b/src/Twilio/Rest/Insights/V1/Call/AnnotationContext.php @@ -58,7 +58,7 @@ public function __construct( public function fetch(): AnnotationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AnnotationInstance( $this->version, diff --git a/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php b/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php index bb633daaa..94ddcc738 100644 --- a/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php +++ b/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php @@ -65,7 +65,7 @@ public function fetch(array $options = []): CallSummaryInstance $options['processingState'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new CallSummaryInstance( $this->version, diff --git a/src/Twilio/Rest/Insights/V1/CallContext.php b/src/Twilio/Rest/Insights/V1/CallContext.php index 82632f283..4f756ddf0 100644 --- a/src/Twilio/Rest/Insights/V1/CallContext.php +++ b/src/Twilio/Rest/Insights/V1/CallContext.php @@ -73,7 +73,7 @@ public function __construct( public function fetch(): CallInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CallInstance( $this->version, diff --git a/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php b/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php index b7b3adfd8..26584f155 100644 --- a/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php +++ b/src/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php @@ -72,7 +72,7 @@ public function fetch(array $options = []): ConferenceParticipantInstance $options['metrics'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new ConferenceParticipantInstance( $this->version, diff --git a/src/Twilio/Rest/Insights/V1/ConferenceContext.php b/src/Twilio/Rest/Insights/V1/ConferenceContext.php index c52aa628c..fb9de8da8 100644 --- a/src/Twilio/Rest/Insights/V1/ConferenceContext.php +++ b/src/Twilio/Rest/Insights/V1/ConferenceContext.php @@ -63,7 +63,7 @@ public function __construct( public function fetch(): ConferenceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConferenceInstance( $this->version, diff --git a/src/Twilio/Rest/Insights/V1/Room/ParticipantContext.php b/src/Twilio/Rest/Insights/V1/Room/ParticipantContext.php index c92da3186..a3e1dc585 100644 --- a/src/Twilio/Rest/Insights/V1/Room/ParticipantContext.php +++ b/src/Twilio/Rest/Insights/V1/Room/ParticipantContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): ParticipantInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, diff --git a/src/Twilio/Rest/Insights/V1/RoomContext.php b/src/Twilio/Rest/Insights/V1/RoomContext.php index fca92dbf5..fceb9ddfe 100644 --- a/src/Twilio/Rest/Insights/V1/RoomContext.php +++ b/src/Twilio/Rest/Insights/V1/RoomContext.php @@ -63,7 +63,7 @@ public function __construct( public function fetch(): RoomInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoomInstance( $this->version, diff --git a/src/Twilio/Rest/Insights/V1/SettingContext.php b/src/Twilio/Rest/Insights/V1/SettingContext.php index 8d08c07e2..298181cc7 100644 --- a/src/Twilio/Rest/Insights/V1/SettingContext.php +++ b/src/Twilio/Rest/Insights/V1/SettingContext.php @@ -61,7 +61,7 @@ public function fetch(array $options = []): SettingInstance $options['subaccountSid'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new SettingInstance( $this->version, diff --git a/src/Twilio/Rest/Intelligence/V2/ServiceContext.php b/src/Twilio/Rest/Intelligence/V2/ServiceContext.php index 3c82ec8dc..cfb4fdff7 100644 --- a/src/Twilio/Rest/Intelligence/V2/ServiceContext.php +++ b/src/Twilio/Rest/Intelligence/V2/ServiceContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php b/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php index 70d5720d2..8192ab62e 100644 --- a/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php +++ b/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php @@ -66,7 +66,7 @@ public function fetch(array $options = []): MediaInstance Serialize::booleanToString($options['redacted']), ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new MediaInstance( $this->version, diff --git a/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php b/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php index 4c418a7ef..197c4c158 100644 --- a/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php +++ b/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php @@ -71,7 +71,7 @@ public function fetch(array $options = []): OperatorResultInstance Serialize::booleanToString($options['redacted']), ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new OperatorResultInstance( $this->version, diff --git a/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php b/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php index 569899d2f..641720b08 100644 --- a/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php +++ b/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php @@ -83,7 +83,7 @@ public function delete(): bool public function fetch(): TranscriptInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TranscriptInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php b/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php index 961309ea5..7e7960078 100644 --- a/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php +++ b/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): CredentialInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php index 5dc14a5b7..198e7877c 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): InviteInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InviteInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php index f5e9560d5..ca61b0287 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): MemberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php index 2a5ac6ee1..7d44ec078 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php +++ b/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): MessageInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php b/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php index 50832566d..bfa5dae08 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php +++ b/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): ChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php b/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php index f29753217..bd2c1d6e8 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php +++ b/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): RoleInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php b/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php index 9ca7c383b..dad7fdc9a 100644 --- a/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php +++ b/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php @@ -82,7 +82,7 @@ public function delete(): bool public function fetch(): UserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php b/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php index 8220c71fa..abea4fb44 100644 --- a/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php +++ b/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php @@ -87,7 +87,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php b/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php index a6750572c..1de315489 100644 --- a/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): CredentialInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php index 00f629107..20552c1ed 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): BindingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BindingInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php index 24cf5ca4c..de96a7135 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): InviteInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InviteInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php index f3cb4874e..350273b55 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): MemberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php index 2db834b98..95b045337 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): MessageInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php index 8220f5cad..0dcc2a059 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php @@ -81,7 +81,7 @@ public function delete(): bool public function fetch(): WebhookInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php index 7cd6bcc3c..89d3e6611 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php @@ -101,7 +101,7 @@ public function delete(array $options = []): bool public function fetch(): ChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php index 04e6ae711..0c5fec366 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): RoleInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php index 5679b7d81..92471ebd9 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): UserBindingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserBindingInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php index 35d2fd946..70297d1ce 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php @@ -81,7 +81,7 @@ public function delete(): bool public function fetch(): UserChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserChannelInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php b/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php index ece41ba2d..448eb177f 100644 --- a/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php @@ -87,7 +87,7 @@ public function delete(): bool public function fetch(): UserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, diff --git a/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php b/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php index c93dcc6a3..0e80e2bf7 100644 --- a/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php +++ b/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php b/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php index 8e0e8f208..74286fb72 100644 --- a/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php +++ b/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php @@ -71,7 +71,7 @@ public function fetch(array $options = []): PhoneNumberInstance ]); $params = \array_merge($params, Serialize::prefixedCollapsibleMap($options['addOnsData'], 'AddOns')); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new PhoneNumberInstance( $this->version, diff --git a/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php b/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php index 2c66c1317..8bcc388e2 100644 --- a/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php +++ b/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php @@ -89,7 +89,7 @@ public function fetch(array $options = []): PhoneNumberInstance $options['lastVerifiedDate'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new PhoneNumberInstance( $this->version, diff --git a/src/Twilio/Rest/Media/V1/MediaProcessorContext.php b/src/Twilio/Rest/Media/V1/MediaProcessorContext.php deleted file mode 100644 index 9d72f527b..000000000 --- a/src/Twilio/Rest/Media/V1/MediaProcessorContext.php +++ /dev/null @@ -1,107 +0,0 @@ -solution = [ - 'sid' => - $sid, - ]; - - $this->uri = '/MediaProcessors/' . \rawurlencode($sid) - .''; - } - - /** - * Fetch the MediaProcessorInstance - * - * @return MediaProcessorInstance Fetched MediaProcessorInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function fetch(): MediaProcessorInstance - { - - $payload = $this->version->fetch('GET', $this->uri); - - return new MediaProcessorInstance( - $this->version, - $payload, - $this->solution['sid'] - ); - } - - - /** - * Update the MediaProcessorInstance - * - * @param string $status - * @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) . ']'; - } -} diff --git a/src/Twilio/Rest/Media/V1/MediaProcessorInstance.php b/src/Twilio/Rest/Media/V1/MediaProcessorInstance.php deleted file mode 100644 index a86646e2c..000000000 --- a/src/Twilio/Rest/Media/V1/MediaProcessorInstance.php +++ /dev/null @@ -1,151 +0,0 @@ -properties = [ - 'accountSid' => Values::array_get($payload, 'account_sid'), - 'sid' => Values::array_get($payload, 'sid'), - 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), - 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), - 'extension' => Values::array_get($payload, 'extension'), - 'extensionContext' => Values::array_get($payload, 'extension_context'), - 'status' => Values::array_get($payload, 'status'), - 'url' => Values::array_get($payload, 'url'), - 'endedReason' => Values::array_get($payload, 'ended_reason'), - 'statusCallback' => Values::array_get($payload, 'status_callback'), - 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), - 'maxDuration' => Values::array_get($payload, 'max_duration'), - ]; - - $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; - } - - /** - * Generate an instance context for the instance, the context is capable of - * performing various actions. All instance actions are proxied to the context - * - * @return MediaProcessorContext Context for this MediaProcessorInstance - */ - protected function proxy(): MediaProcessorContext - { - if (!$this->context) { - $this->context = new MediaProcessorContext( - $this->version, - $this->solution['sid'] - ); - } - - return $this->context; - } - - /** - * Fetch the MediaProcessorInstance - * - * @return MediaProcessorInstance Fetched MediaProcessorInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function fetch(): MediaProcessorInstance - { - - return $this->proxy()->fetch(); - } - - /** - * Update the MediaProcessorInstance - * - * @param string $status - * @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) . ']'; - } -} - diff --git a/src/Twilio/Rest/Media/V1/MediaProcessorList.php b/src/Twilio/Rest/Media/V1/MediaProcessorList.php deleted file mode 100644 index f4496dad1..000000000 --- a/src/Twilio/Rest/Media/V1/MediaProcessorList.php +++ /dev/null @@ -1,210 +0,0 @@ -solution = [ - ]; - - $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]'; - } -} diff --git a/src/Twilio/Rest/Media/V1/MediaProcessorOptions.php b/src/Twilio/Rest/Media/V1/MediaProcessorOptions.php deleted file mode 100644 index db6bd6f67..000000000 --- a/src/Twilio/Rest/Media/V1/MediaProcessorOptions.php +++ /dev/null @@ -1,204 +0,0 @@ -options['extensionEnvironment'] = $extensionEnvironment; - $this->options['statusCallback'] = $statusCallback; - $this->options['statusCallbackMethod'] = $statusCallbackMethod; - $this->options['maxDuration'] = $maxDuration; - } - - /** - * User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/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 . ']'; - } -} - - diff --git a/src/Twilio/Rest/Media/V1/MediaRecordingContext.php b/src/Twilio/Rest/Media/V1/MediaRecordingContext.php deleted file mode 100644 index 0028801ff..000000000 --- a/src/Twilio/Rest/Media/V1/MediaRecordingContext.php +++ /dev/null @@ -1,94 +0,0 @@ -solution = [ - 'sid' => - $sid, - ]; - - $this->uri = '/MediaRecordings/' . \rawurlencode($sid) - .''; - } - - /** - * Delete the MediaRecordingInstance - * - * @return bool True if delete succeeds, false otherwise - * @throws TwilioException When an HTTP error occurs. - */ - public function delete(): bool - { - - return $this->version->delete('DELETE', $this->uri); - } - - - /** - * Fetch the MediaRecordingInstance - * - * @return MediaRecordingInstance Fetched MediaRecordingInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function fetch(): MediaRecordingInstance - { - - $payload = $this->version->fetch('GET', $this->uri); - - return new MediaRecordingInstance( - $this->version, - $payload, - $this->solution['sid'] - ); - } - - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString(): string - { - $context = []; - foreach ($this->solution as $key => $value) { - $context[] = "$key=$value"; - } - return '[Twilio.Media.V1.MediaRecordingContext ' . \implode(' ', $context) . ']'; - } -} diff --git a/src/Twilio/Rest/Media/V1/MediaRecordingInstance.php b/src/Twilio/Rest/Media/V1/MediaRecordingInstance.php deleted file mode 100644 index f40d9585d..000000000 --- a/src/Twilio/Rest/Media/V1/MediaRecordingInstance.php +++ /dev/null @@ -1,156 +0,0 @@ -properties = [ - 'accountSid' => Values::array_get($payload, 'account_sid'), - 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), - 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), - 'duration' => Values::array_get($payload, 'duration'), - 'format' => Values::array_get($payload, 'format'), - 'links' => Values::array_get($payload, 'links'), - 'processorSid' => Values::array_get($payload, 'processor_sid'), - 'resolution' => Values::array_get($payload, 'resolution'), - 'sourceSid' => Values::array_get($payload, 'source_sid'), - 'sid' => Values::array_get($payload, 'sid'), - 'mediaSize' => Values::array_get($payload, 'media_size'), - 'status' => Values::array_get($payload, 'status'), - 'statusCallback' => Values::array_get($payload, 'status_callback'), - 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), - 'url' => Values::array_get($payload, 'url'), - ]; - - $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; - } - - /** - * Generate an instance context for the instance, the context is capable of - * performing various actions. All instance actions are proxied to the context - * - * @return MediaRecordingContext Context for this MediaRecordingInstance - */ - protected function proxy(): MediaRecordingContext - { - if (!$this->context) { - $this->context = new MediaRecordingContext( - $this->version, - $this->solution['sid'] - ); - } - - return $this->context; - } - - /** - * Delete the MediaRecordingInstance - * - * @return bool True if delete succeeds, false otherwise - * @throws TwilioException When an HTTP error occurs. - */ - public function delete(): bool - { - - return $this->proxy()->delete(); - } - - /** - * Fetch the MediaRecordingInstance - * - * @return MediaRecordingInstance Fetched MediaRecordingInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function fetch(): MediaRecordingInstance - { - - return $this->proxy()->fetch(); - } - - /** - * Magic getter to access properties - * - * @param string $name Property to access - * @return mixed The requested property - * @throws TwilioException For unknown properties - */ - public function __get(string $name) - { - if (\array_key_exists($name, $this->properties)) { - return $this->properties[$name]; - } - - if (\property_exists($this, '_' . $name)) { - $method = 'get' . \ucfirst($name); - return $this->$method(); - } - - throw new TwilioException('Unknown property: ' . $name); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString(): string - { - $context = []; - foreach ($this->solution as $key => $value) { - $context[] = "$key=$value"; - } - return '[Twilio.Media.V1.MediaRecordingInstance ' . \implode(' ', $context) . ']'; - } -} - diff --git a/src/Twilio/Rest/Media/V1/MediaRecordingList.php b/src/Twilio/Rest/Media/V1/MediaRecordingList.php deleted file mode 100644 index 5b1a7dd6a..000000000 --- a/src/Twilio/Rest/Media/V1/MediaRecordingList.php +++ /dev/null @@ -1,174 +0,0 @@ -solution = [ - ]; - - $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]'; - } -} diff --git a/src/Twilio/Rest/Media/V1/MediaRecordingOptions.php b/src/Twilio/Rest/Media/V1/MediaRecordingOptions.php deleted file mode 100644 index 2ff103bd8..000000000 --- a/src/Twilio/Rest/Media/V1/MediaRecordingOptions.php +++ /dev/null @@ -1,134 +0,0 @@ -options['order'] = $order; - $this->options['status'] = $status; - $this->options['processorSid'] = $processorSid; - $this->options['sourceSid'] = $sourceSid; - } - - /** - * The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - * - * @param string $order The sort order of the list 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 . ']'; - } -} - diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantInstance.php b/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantInstance.php deleted file mode 100644 index ea5f88194..000000000 --- a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantInstance.php +++ /dev/null @@ -1,138 +0,0 @@ -properties = [ - 'sid' => Values::array_get($payload, 'sid'), - 'url' => Values::array_get($payload, 'url'), - 'accountSid' => Values::array_get($payload, 'account_sid'), - 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), - 'grant' => Values::array_get($payload, 'grant'), - ]; - - $this->solution = ['sid' => $sid, ]; - } - - /** - * Generate an instance context for the instance, the context is capable of - * performing various actions. All instance actions are proxied to the context - * - * @return PlaybackGrantContext Context for this PlaybackGrantInstance - */ - protected function proxy(): PlaybackGrantContext - { - if (!$this->context) { - $this->context = new PlaybackGrantContext( - $this->version, - $this->solution['sid'] - ); - } - - return $this->context; - } - - /** - * Create the PlaybackGrantInstance - * - * @param array|Options $options Optional Arguments - * @return PlaybackGrantInstance Created PlaybackGrantInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function create(array $options = []): PlaybackGrantInstance - { - - return $this->proxy()->create($options); - } - - /** - * Fetch the PlaybackGrantInstance - * - * @return PlaybackGrantInstance Fetched PlaybackGrantInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function fetch(): PlaybackGrantInstance - { - - return $this->proxy()->fetch(); - } - - /** - * Magic getter to access properties - * - * @param string $name Property to access - * @return mixed The requested property - * @throws TwilioException For unknown properties - */ - public function __get(string $name) - { - if (\array_key_exists($name, $this->properties)) { - return $this->properties[$name]; - } - - if (\property_exists($this, '_' . $name)) { - $method = 'get' . \ucfirst($name); - return $this->$method(); - } - - throw new TwilioException('Unknown property: ' . $name); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString(): string - { - $context = []; - foreach ($this->solution as $key => $value) { - $context[] = "$key=$value"; - } - return '[Twilio.Media.V1.PlaybackGrantInstance ' . \implode(' ', $context) . ']'; - } -} - diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantOptions.php b/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantOptions.php deleted file mode 100644 index ab26c9e2b..000000000 --- a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantOptions.php +++ /dev/null @@ -1,96 +0,0 @@ -options['ttl'] = $ttl; - $this->options['accessControlAllowOrigin'] = $accessControlAllowOrigin; - } - - /** - * The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. - * - * @param int $ttl The time to live of the PlaybackGrant. 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 . ']'; - } -} - - diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamerContext.php b/src/Twilio/Rest/Media/V1/PlayerStreamerContext.php deleted file mode 100644 index e678f4ef6..000000000 --- a/src/Twilio/Rest/Media/V1/PlayerStreamerContext.php +++ /dev/null @@ -1,165 +0,0 @@ -solution = [ - 'sid' => - $sid, - ]; - - $this->uri = '/PlayerStreamers/' . \rawurlencode($sid) - .''; - } - - /** - * Fetch the PlayerStreamerInstance - * - * @return PlayerStreamerInstance Fetched PlayerStreamerInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function fetch(): PlayerStreamerInstance - { - - $payload = $this->version->fetch('GET', $this->uri); - - return new PlayerStreamerInstance( - $this->version, - $payload, - $this->solution['sid'] - ); - } - - - /** - * Update the PlayerStreamerInstance - * - * @param string $status - * @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) . ']'; - } -} diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamerInstance.php b/src/Twilio/Rest/Media/V1/PlayerStreamerInstance.php deleted file mode 100644 index 15894436b..000000000 --- a/src/Twilio/Rest/Media/V1/PlayerStreamerInstance.php +++ /dev/null @@ -1,162 +0,0 @@ -properties = [ - 'accountSid' => Values::array_get($payload, 'account_sid'), - 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), - 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), - 'video' => Values::array_get($payload, 'video'), - 'links' => Values::array_get($payload, 'links'), - 'sid' => Values::array_get($payload, 'sid'), - 'status' => Values::array_get($payload, 'status'), - 'url' => Values::array_get($payload, 'url'), - 'statusCallback' => Values::array_get($payload, 'status_callback'), - 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), - 'endedReason' => Values::array_get($payload, 'ended_reason'), - 'maxDuration' => Values::array_get($payload, 'max_duration'), - ]; - - $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; - } - - /** - * Generate an instance context for the instance, the context is capable of - * performing various actions. All instance actions are proxied to the context - * - * @return PlayerStreamerContext Context for this PlayerStreamerInstance - */ - protected function proxy(): PlayerStreamerContext - { - if (!$this->context) { - $this->context = new PlayerStreamerContext( - $this->version, - $this->solution['sid'] - ); - } - - return $this->context; - } - - /** - * Fetch the PlayerStreamerInstance - * - * @return PlayerStreamerInstance Fetched PlayerStreamerInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function fetch(): PlayerStreamerInstance - { - - return $this->proxy()->fetch(); - } - - /** - * Update the PlayerStreamerInstance - * - * @param string $status - * @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) . ']'; - } -} - diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamerList.php b/src/Twilio/Rest/Media/V1/PlayerStreamerList.php deleted file mode 100644 index afec11167..000000000 --- a/src/Twilio/Rest/Media/V1/PlayerStreamerList.php +++ /dev/null @@ -1,204 +0,0 @@ -solution = [ - ]; - - $this->uri = '/PlayerStreamers'; - } - - /** - * Create the PlayerStreamerInstance - * - * @param array|Options $options Optional Arguments - * @return PlayerStreamerInstance Created PlayerStreamerInstance - * @throws TwilioException When an HTTP error occurs. - */ - public function create(array $options = []): PlayerStreamerInstance - { - - $options = new Values($options); - - $data = Values::of([ - 'Video' => - Serialize::booleanToString($options['video']), - 'StatusCallback' => - $options['statusCallback'], - 'StatusCallbackMethod' => - $options['statusCallbackMethod'], - 'MaxDuration' => - $options['maxDuration'], - ]); - - $payload = $this->version->create('POST', $this->uri, [], $data); - - return new PlayerStreamerInstance( - $this->version, - $payload - ); - } - - - /** - * 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]'; - } -} diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamerOptions.php b/src/Twilio/Rest/Media/V1/PlayerStreamerOptions.php deleted file mode 100644 index a9af1ede5..000000000 --- a/src/Twilio/Rest/Media/V1/PlayerStreamerOptions.php +++ /dev/null @@ -1,204 +0,0 @@ -options['video'] = $video; - $this->options['statusCallback'] = $statusCallback; - $this->options['statusCallbackMethod'] = $statusCallbackMethod; - $this->options['maxDuration'] = $maxDuration; - } - - /** - * Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. - * - * @param bool $video 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 . ']'; - } -} - - diff --git a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php index 00372df6a..2cf37776f 100644 --- a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php +++ b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php @@ -55,7 +55,7 @@ public function __construct( public function create(): BrandRegistrationOtpInstance { - $payload = $this->version->create('POST', $this->uri); + $payload = $this->version->create('POST', $this->uri, [], []); return new BrandRegistrationOtpInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php index a4de43ca0..b51b1e39a 100644 --- a/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php +++ b/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): BrandVettingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BrandVettingInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php b/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php index bf392e19c..bb3d11620 100644 --- a/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php +++ b/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php @@ -66,7 +66,7 @@ public function __construct( public function fetch(): BrandRegistrationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BrandRegistrationInstance( $this->version, @@ -85,7 +85,7 @@ public function fetch(): BrandRegistrationInstance public function update(): BrandRegistrationInstance { - $payload = $this->version->update('POST', $this->uri); + $payload = $this->version->update('POST', $this->uri, [], []); return new BrandRegistrationInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php b/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php index 8bc9be194..c46b1226f 100644 --- a/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php +++ b/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php @@ -61,7 +61,7 @@ public function fetch(array $options = []): DeactivationsInstance Serialize::iso8601Date($options['date']), ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new DeactivationsInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php b/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php index 1bfade3f9..5ca6ec35d 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php +++ b/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php @@ -69,7 +69,7 @@ public function delete(): bool public function fetch(): DomainCertsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DomainCertsInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php b/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php index ef3feec0e..e5482d53b 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php +++ b/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php @@ -58,7 +58,7 @@ public function __construct( public function fetch(): DomainConfigInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DomainConfigInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php b/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php index 2f9c3da17..13c307a16 100644 --- a/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php +++ b/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): DomainConfigMessagingServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DomainConfigMessagingServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php index c6f3b0773..32e44be5c 100644 --- a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php +++ b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php @@ -60,7 +60,7 @@ public function __construct( public function create(): LinkshorteningMessagingServiceInstance { - $payload = $this->version->create('POST', $this->uri); + $payload = $this->version->create('POST', $this->uri, [], []); return new LinkshorteningMessagingServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php index 26c72b8b0..cf87916c8 100644 --- a/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php +++ b/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): LinkshorteningMessagingServiceDomainAssociationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new LinkshorteningMessagingServiceDomainAssociationInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php b/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php index 586822e0f..d9a198f92 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php +++ b/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): AlphaSenderInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AlphaSenderInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php b/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php index 46f390715..08c9b43e7 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php +++ b/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): ChannelSenderInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelSenderInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php b/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php index b26c10dee..01d03e2b3 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php +++ b/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): PhoneNumberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PhoneNumberInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php b/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php index 38b5fb86f..80059a142 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php +++ b/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): ShortCodeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ShortCodeInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php index 6ba756c68..77b9d1af9 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php +++ b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): UsAppToPersonInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UsAppToPersonInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php index e29fd4324..252d21eed 100644 --- a/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php +++ b/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php @@ -65,7 +65,7 @@ public function fetch(array $options = []): UsAppToPersonUsecaseInstance $options['brandRegistrationSid'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new UsAppToPersonUsecaseInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/ServiceContext.php b/src/Twilio/Rest/Messaging/V1/ServiceContext.php index 69c4b4ac6..cc4f3e6a9 100644 --- a/src/Twilio/Rest/Messaging/V1/ServiceContext.php +++ b/src/Twilio/Rest/Messaging/V1/ServiceContext.php @@ -98,7 +98,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php index 019e8de82..c19dbf94c 100644 --- a/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php +++ b/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): TollfreeVerificationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TollfreeVerificationInstance( $this->version, diff --git a/src/Twilio/Rest/Messaging/V1/UsecaseList.php b/src/Twilio/Rest/Messaging/V1/UsecaseList.php index 715b0898e..e7cf66aa9 100644 --- a/src/Twilio/Rest/Messaging/V1/UsecaseList.php +++ b/src/Twilio/Rest/Messaging/V1/UsecaseList.php @@ -49,7 +49,7 @@ public function __construct( public function fetch(): UsecaseInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new UsecaseInstance( $this->version, diff --git a/src/Twilio/Rest/Microvisor/V1/AccountConfigContext.php b/src/Twilio/Rest/Microvisor/V1/AccountConfigContext.php index b5aaf4fbb..2fea6fa51 100644 --- a/src/Twilio/Rest/Microvisor/V1/AccountConfigContext.php +++ b/src/Twilio/Rest/Microvisor/V1/AccountConfigContext.php @@ -69,7 +69,7 @@ public function delete(): bool public function fetch(): AccountConfigInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AccountConfigInstance( $this->version, diff --git a/src/Twilio/Rest/Microvisor/V1/AccountSecretContext.php b/src/Twilio/Rest/Microvisor/V1/AccountSecretContext.php index b22ce57d7..903584f54 100644 --- a/src/Twilio/Rest/Microvisor/V1/AccountSecretContext.php +++ b/src/Twilio/Rest/Microvisor/V1/AccountSecretContext.php @@ -69,7 +69,7 @@ public function delete(): bool public function fetch(): AccountSecretInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AccountSecretInstance( $this->version, diff --git a/src/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php b/src/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php index f1699c218..84072726f 100644 --- a/src/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php +++ b/src/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): AppManifestInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AppManifestInstance( $this->version, diff --git a/src/Twilio/Rest/Microvisor/V1/AppContext.php b/src/Twilio/Rest/Microvisor/V1/AppContext.php index 8bd8584b5..2ee92954a 100644 --- a/src/Twilio/Rest/Microvisor/V1/AppContext.php +++ b/src/Twilio/Rest/Microvisor/V1/AppContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): AppInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AppInstance( $this->version, diff --git a/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php b/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php index 6644b60f8..6359e4a3b 100644 --- a/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php +++ b/src/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php @@ -74,7 +74,7 @@ public function delete(): bool public function fetch(): DeviceConfigInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeviceConfigInstance( $this->version, diff --git a/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php b/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php index f5cb7dafc..1f8dd6903 100644 --- a/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php +++ b/src/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php @@ -74,7 +74,7 @@ public function delete(): bool public function fetch(): DeviceSecretInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeviceSecretInstance( $this->version, diff --git a/src/Twilio/Rest/Microvisor/V1/DeviceContext.php b/src/Twilio/Rest/Microvisor/V1/DeviceContext.php index cb2fc10c9..9769cb0b3 100644 --- a/src/Twilio/Rest/Microvisor/V1/DeviceContext.php +++ b/src/Twilio/Rest/Microvisor/V1/DeviceContext.php @@ -70,7 +70,7 @@ public function __construct( public function fetch(): DeviceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeviceInstance( $this->version, diff --git a/src/Twilio/Rest/Monitor/V1/AlertContext.php b/src/Twilio/Rest/Monitor/V1/AlertContext.php index da7a6ccd1..18270cfbe 100644 --- a/src/Twilio/Rest/Monitor/V1/AlertContext.php +++ b/src/Twilio/Rest/Monitor/V1/AlertContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): AlertInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AlertInstance( $this->version, diff --git a/src/Twilio/Rest/Monitor/V1/EventContext.php b/src/Twilio/Rest/Monitor/V1/EventContext.php index c18bd7aa3..c8756e1cf 100644 --- a/src/Twilio/Rest/Monitor/V1/EventContext.php +++ b/src/Twilio/Rest/Monitor/V1/EventContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): EventInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EventInstance( $this->version, diff --git a/src/Twilio/Rest/Notify/V1/CredentialContext.php b/src/Twilio/Rest/Notify/V1/CredentialContext.php index 895ca3712..4e95b8ab8 100644 --- a/src/Twilio/Rest/Notify/V1/CredentialContext.php +++ b/src/Twilio/Rest/Notify/V1/CredentialContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): CredentialInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, diff --git a/src/Twilio/Rest/Notify/V1/Service/BindingContext.php b/src/Twilio/Rest/Notify/V1/Service/BindingContext.php index 93e4adddd..62896d753 100644 --- a/src/Twilio/Rest/Notify/V1/Service/BindingContext.php +++ b/src/Twilio/Rest/Notify/V1/Service/BindingContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): BindingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BindingInstance( $this->version, diff --git a/src/Twilio/Rest/Notify/V1/ServiceContext.php b/src/Twilio/Rest/Notify/V1/ServiceContext.php index 0014f734c..a6138cba8 100644 --- a/src/Twilio/Rest/Notify/V1/ServiceContext.php +++ b/src/Twilio/Rest/Notify/V1/ServiceContext.php @@ -82,7 +82,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V1.php b/src/Twilio/Rest/Numbers/V1.php index 6e6552e77..b7792c883 100644 --- a/src/Twilio/Rest/Numbers/V1.php +++ b/src/Twilio/Rest/Numbers/V1.php @@ -19,14 +19,18 @@ use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Numbers\V1\BulkEligibilityList; +use Twilio\Rest\Numbers\V1\EligibilityList; use Twilio\Rest\Numbers\V1\PortingBulkPortabilityList; +use Twilio\Rest\Numbers\V1\PortingPortInList; use Twilio\Rest\Numbers\V1\PortingPortInFetchList; use Twilio\Rest\Numbers\V1\PortingPortabilityList; use Twilio\Version; /** * @property BulkEligibilityList $bulkEligibilities + * @property EligibilityList $eligibilities * @property PortingBulkPortabilityList $portingBulkPortabilities + * @property PortingPortInList $portingPortIns * @property PortingPortInFetchList $portingPortInsFetch * @property PortingPortabilityList $portingPortabilities * @method \Twilio\Rest\Numbers\V1\BulkEligibilityContext bulkEligibilities(string $requestId) @@ -37,7 +41,9 @@ class V1 extends Version { protected $_bulkEligibilities; + protected $_eligibilities; protected $_portingBulkPortabilities; + protected $_portingPortIns; protected $_portingPortInsFetch; protected $_portingPortabilities; @@ -60,6 +66,14 @@ protected function getBulkEligibilities(): BulkEligibilityList return $this->_bulkEligibilities; } + protected function getEligibilities(): EligibilityList + { + if (!$this->_eligibilities) { + $this->_eligibilities = new EligibilityList($this); + } + return $this->_eligibilities; + } + protected function getPortingBulkPortabilities(): PortingBulkPortabilityList { if (!$this->_portingBulkPortabilities) { @@ -68,6 +82,14 @@ protected function getPortingBulkPortabilities(): PortingBulkPortabilityList return $this->_portingBulkPortabilities; } + protected function getPortingPortIns(): PortingPortInList + { + if (!$this->_portingPortIns) { + $this->_portingPortIns = new PortingPortInList($this); + } + return $this->_portingPortIns; + } + protected function getPortingPortInsFetch(): PortingPortInFetchList { if (!$this->_portingPortInsFetch) { diff --git a/src/Twilio/Rest/Numbers/V1/BulkEligibilityContext.php b/src/Twilio/Rest/Numbers/V1/BulkEligibilityContext.php index de7f6c2e1..a45e87d08 100644 --- a/src/Twilio/Rest/Numbers/V1/BulkEligibilityContext.php +++ b/src/Twilio/Rest/Numbers/V1/BulkEligibilityContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): BulkEligibilityInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BulkEligibilityInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V1/BulkEligibilityList.php b/src/Twilio/Rest/Numbers/V1/BulkEligibilityList.php index 58fa450bb..043abde07 100644 --- a/src/Twilio/Rest/Numbers/V1/BulkEligibilityList.php +++ b/src/Twilio/Rest/Numbers/V1/BulkEligibilityList.php @@ -16,6 +16,7 @@ namespace Twilio\Rest\Numbers\V1; +use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; @@ -35,8 +36,30 @@ public function __construct( // Path Solution $this->solution = [ ]; + + $this->uri = '/HostedNumber/Eligibility/Bulk'; + } + + /** + * Create the BulkEligibilityInstance + * + * @return BulkEligibilityInstance Created BulkEligibilityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): BulkEligibilityInstance + { + + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BulkEligibilityInstance( + $this->version, + $payload + ); } + /** * Constructs a BulkEligibilityContext * diff --git a/src/Twilio/Rest/Numbers/V1/EligibilityInstance.php b/src/Twilio/Rest/Numbers/V1/EligibilityInstance.php new file mode 100644 index 000000000..6121a620d --- /dev/null +++ b/src/Twilio/Rest/Numbers/V1/EligibilityInstance.php @@ -0,0 +1,80 @@ +properties = [ + 'results' => Values::array_get($payload, 'results'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.EligibilityInstance]'; + } +} + diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantList.php b/src/Twilio/Rest/Numbers/V1/EligibilityList.php similarity index 57% rename from src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantList.php rename to src/Twilio/Rest/Numbers/V1/EligibilityList.php index d08ce702b..52bdd8ef9 100644 --- a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantList.php +++ b/src/Twilio/Rest/Numbers/V1/EligibilityList.php @@ -6,7 +6,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Media + * Twilio - Numbers * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -14,47 +14,52 @@ * Do not edit the class manually. */ -namespace Twilio\Rest\Media\V1\PlayerStreamer; +namespace Twilio\Rest\Numbers\V1; +use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; -class PlaybackGrantList extends ListResource +class EligibilityList extends ListResource { /** - * Construct the PlaybackGrantList + * Construct the EligibilityList * * @param Version $version Version that contains the resource - * @param string $sid The unique string generated to identify the PlayerStreamer resource associated with this PlaybackGrant */ public function __construct( - Version $version, - string $sid + Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ - 'sid' => - $sid, - ]; + + $this->uri = '/HostedNumber/Eligibility'; } /** - * Constructs a PlaybackGrantContext + * Create the EligibilityInstance + * + * @return EligibilityInstance Created EligibilityInstance + * @throws TwilioException When an HTTP error occurs. */ - public function getContext( - - ): PlaybackGrantContext + public function create(): EligibilityInstance { - return new PlaybackGrantContext( + + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new EligibilityInstance( $this->version, - $this->solution['sid'] + $payload ); } + /** * Provide a friendly representation * @@ -62,6 +67,6 @@ public function getContext( */ public function __toString(): string { - return '[Twilio.Media.V1.PlaybackGrantList]'; + return '[Twilio.Numbers.V1.EligibilityList]'; } } diff --git a/src/Twilio/Rest/Media/V1/MediaProcessorPage.php b/src/Twilio/Rest/Numbers/V1/EligibilityPage.php similarity index 76% rename from src/Twilio/Rest/Media/V1/MediaProcessorPage.php rename to src/Twilio/Rest/Numbers/V1/EligibilityPage.php index b3866c50c..e93779b61 100644 --- a/src/Twilio/Rest/Media/V1/MediaProcessorPage.php +++ b/src/Twilio/Rest/Numbers/V1/EligibilityPage.php @@ -5,7 +5,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Media + * Twilio - Numbers * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -13,13 +13,13 @@ * Do not edit the class manually. */ -namespace Twilio\Rest\Media\V1; +namespace Twilio\Rest\Numbers\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; -class MediaProcessorPage extends Page +class EligibilityPage extends Page { /** * @param Version $version Version that contains the resource @@ -36,11 +36,11 @@ public function __construct(Version $version, Response $response, array $solutio /** * @param array $payload Payload response from the API - * @return MediaProcessorInstance \Twilio\Rest\Media\V1\MediaProcessorInstance + * @return EligibilityInstance \Twilio\Rest\Numbers\V1\EligibilityInstance */ - public function buildInstance(array $payload): MediaProcessorInstance + public function buildInstance(array $payload): EligibilityInstance { - return new MediaProcessorInstance($this->version, $payload); + return new EligibilityInstance($this->version, $payload); } /** @@ -50,6 +50,6 @@ public function buildInstance(array $payload): MediaProcessorInstance */ public function __toString(): string { - return '[Twilio.Media.V1.MediaProcessorPage]'; + return '[Twilio.Numbers.V1.EligibilityPage]'; } } diff --git a/src/Twilio/Rest/Numbers/V1/PortingBulkPortabilityContext.php b/src/Twilio/Rest/Numbers/V1/PortingBulkPortabilityContext.php index 581023096..811da9514 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingBulkPortabilityContext.php +++ b/src/Twilio/Rest/Numbers/V1/PortingBulkPortabilityContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): PortingBulkPortabilityInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PortingBulkPortabilityInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInFetchContext.php b/src/Twilio/Rest/Numbers/V1/PortingPortInFetchContext.php index ac772fea6..3a172369e 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortInFetchContext.php +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInFetchContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): PortingPortInFetchInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PortingPortInFetchInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInFetchInstance.php b/src/Twilio/Rest/Numbers/V1/PortingPortInFetchInstance.php index 1043a38ce..a6bf2b2d1 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortInFetchInstance.php +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInFetchInstance.php @@ -32,6 +32,7 @@ * @property \DateTime|null $targetPortInDate * @property string|null $targetPortInTimeRangeStart * @property string|null $targetPortInTimeRangeEnd + * @property string|null $portInRequestStatus * @property array|null $losingCarrierInformation * @property array[]|null $phoneNumbers * @property string[]|null $documents @@ -58,6 +59,7 @@ public function __construct(Version $version, array $payload, string $portInRequ 'targetPortInDate' => Deserialize::dateTime(Values::array_get($payload, 'target_port_in_date')), 'targetPortInTimeRangeStart' => Values::array_get($payload, 'target_port_in_time_range_start'), 'targetPortInTimeRangeEnd' => Values::array_get($payload, 'target_port_in_time_range_end'), + 'portInRequestStatus' => Values::array_get($payload, 'port_in_request_status'), 'losingCarrierInformation' => Values::array_get($payload, 'losing_carrier_information'), 'phoneNumbers' => Values::array_get($payload, 'phone_numbers'), 'documents' => Values::array_get($payload, 'documents'), diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInInstance.php b/src/Twilio/Rest/Numbers/V1/PortingPortInInstance.php new file mode 100644 index 000000000..ba823a263 --- /dev/null +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInInstance.php @@ -0,0 +1,82 @@ +properties = [ + 'portInRequestSid' => Values::array_get($payload, 'port_in_request_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingPortInInstance]'; + } +} + diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortInList.php b/src/Twilio/Rest/Numbers/V1/PortingPortInList.php new file mode 100644 index 000000000..4ee7379e7 --- /dev/null +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInList.php @@ -0,0 +1,72 @@ +solution = [ + ]; + + $this->uri = '/Porting/PortIn'; + } + + /** + * Create the PortingPortInInstance + * + * @return PortingPortInInstance Created PortingPortInInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): PortingPortInInstance + { + + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new PortingPortInInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V1.PortingPortInList]'; + } +} diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantPage.php b/src/Twilio/Rest/Numbers/V1/PortingPortInPage.php similarity index 75% rename from src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantPage.php rename to src/Twilio/Rest/Numbers/V1/PortingPortInPage.php index 3ffa96f5a..5ab620510 100644 --- a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantPage.php +++ b/src/Twilio/Rest/Numbers/V1/PortingPortInPage.php @@ -5,7 +5,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Media + * Twilio - Numbers * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -13,13 +13,13 @@ * Do not edit the class manually. */ -namespace Twilio\Rest\Media\V1\PlayerStreamer; +namespace Twilio\Rest\Numbers\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; -class PlaybackGrantPage extends Page +class PortingPortInPage extends Page { /** * @param Version $version Version that contains the resource @@ -36,11 +36,11 @@ public function __construct(Version $version, Response $response, array $solutio /** * @param array $payload Payload response from the API - * @return PlaybackGrantInstance \Twilio\Rest\Media\V1\PlayerStreamer\PlaybackGrantInstance + * @return PortingPortInInstance \Twilio\Rest\Numbers\V1\PortingPortInInstance */ - public function buildInstance(array $payload): PlaybackGrantInstance + public function buildInstance(array $payload): PortingPortInInstance { - return new PlaybackGrantInstance($this->version, $payload, $this->solution['sid']); + return new PortingPortInInstance($this->version, $payload); } /** @@ -50,6 +50,6 @@ public function buildInstance(array $payload): PlaybackGrantInstance */ public function __toString(): string { - return '[Twilio.Media.V1.PlaybackGrantPage]'; + return '[Twilio.Numbers.V1.PortingPortInPage]'; } } diff --git a/src/Twilio/Rest/Numbers/V1/PortingPortabilityContext.php b/src/Twilio/Rest/Numbers/V1/PortingPortabilityContext.php index 772086c72..7e51ebb02 100644 --- a/src/Twilio/Rest/Numbers/V1/PortingPortabilityContext.php +++ b/src/Twilio/Rest/Numbers/V1/PortingPortabilityContext.php @@ -65,7 +65,7 @@ public function fetch(array $options = []): PortingPortabilityInstance $options['targetAccountSid'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new PortingPortabilityInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentContext.php b/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentContext.php index f305fed42..7931bc674 100644 --- a/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentContext.php +++ b/src/Twilio/Rest/Numbers/V2/AuthorizationDocumentContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): AuthorizationDocumentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthorizationDocumentInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderContext.php b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderContext.php index 00b2c6ae3..505c06f89 100644 --- a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderContext.php +++ b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderContext.php @@ -65,7 +65,7 @@ public function fetch(array $options = []): BulkHostedNumberOrderInstance $options['orderStatus'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new BulkHostedNumberOrderInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderList.php b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderList.php index 4b907af59..c10f6b2fc 100644 --- a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderList.php +++ b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderList.php @@ -16,6 +16,7 @@ namespace Twilio\Rest\Numbers\V2; +use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; @@ -35,8 +36,30 @@ public function __construct( // Path Solution $this->solution = [ ]; + + $this->uri = '/HostedNumber/Orders/Bulk'; + } + + /** + * Create the BulkHostedNumberOrderInstance + * + * @return BulkHostedNumberOrderInstance Created BulkHostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): BulkHostedNumberOrderInstance + { + + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new BulkHostedNumberOrderInstance( + $this->version, + $payload + ); } + /** * Constructs a BulkHostedNumberOrderContext * diff --git a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.php b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.php index a4aebcacc..9b88e31db 100644 --- a/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.php +++ b/src/Twilio/Rest/Numbers/V2/BulkHostedNumberOrderOptions.php @@ -20,6 +20,7 @@ abstract class BulkHostedNumberOrderOptions { + /** * @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 FetchBulkHostedNumberOrderOptions Options builder @@ -37,6 +38,7 @@ public static function fetch( } + class FetchBulkHostedNumberOrderOptions extends Options { /** diff --git a/src/Twilio/Rest/Numbers/V2/HostedNumberOrderContext.php b/src/Twilio/Rest/Numbers/V2/HostedNumberOrderContext.php index 3ac6d06f4..40d249ef9 100644 --- a/src/Twilio/Rest/Numbers/V2/HostedNumberOrderContext.php +++ b/src/Twilio/Rest/Numbers/V2/HostedNumberOrderContext.php @@ -68,7 +68,7 @@ public function delete(): bool public function fetch(): HostedNumberOrderInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new HostedNumberOrderInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php index 0cdfa8b4a..95d03c53a 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): EvaluationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EvaluationInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php index e8fb5d638..139d80aa6 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php @@ -57,7 +57,7 @@ public function __construct( public function create(): EvaluationInstance { - $payload = $this->version->create('POST', $this->uri); + $payload = $this->version->create('POST', $this->uri, [], []); return new EvaluationInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php index 4cb05c862..dd10db34e 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): ItemAssignmentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ItemAssignmentInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php index 26502d864..56f5c9f8c 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php @@ -88,7 +88,7 @@ public function delete(): bool public function fetch(): BundleInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BundleInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php index 5a78ff87b..5a06cf4f3 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): EndUserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EndUserInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php index 218cb0491..03081328b 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): EndUserTypeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EndUserTypeInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php index 572b06325..edf615aa6 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): RegulationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RegulationInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php index 12fa46e14..945936657 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): SupportingDocumentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SupportingDocumentInstance( $this->version, diff --git a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php index 53cb6ec78..6f09f72a4 100644 --- a/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php +++ b/src/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): SupportingDocumentTypeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SupportingDocumentTypeInstance( $this->version, diff --git a/src/Twilio/Rest/Media/V1.php b/src/Twilio/Rest/Oauth/V1.php similarity index 60% rename from src/Twilio/Rest/Media/V1.php rename to src/Twilio/Rest/Oauth/V1.php index 10306e15b..2885d7fa1 100644 --- a/src/Twilio/Rest/Media/V1.php +++ b/src/Twilio/Rest/Oauth/V1.php @@ -5,7 +5,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Media + * Twilio - Oauth * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -13,32 +13,26 @@ * Do not edit the class manually. */ -namespace Twilio\Rest\Media; +namespace Twilio\Rest\Oauth; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; -use Twilio\Rest\Media\V1\MediaProcessorList; -use Twilio\Rest\Media\V1\MediaRecordingList; -use Twilio\Rest\Media\V1\PlayerStreamerList; +use Twilio\Rest\Oauth\V1\AuthorizeList; +use Twilio\Rest\Oauth\V1\TokenList; use Twilio\Version; /** - * @property MediaProcessorList $mediaProcessor - * @property MediaRecordingList $mediaRecording - * @property PlayerStreamerList $playerStreamer - * @method \Twilio\Rest\Media\V1\MediaProcessorContext mediaProcessor(string $sid) - * @method \Twilio\Rest\Media\V1\MediaRecordingContext mediaRecording(string $sid) - * @method \Twilio\Rest\Media\V1\PlayerStreamerContext playerStreamer(string $sid) + * @property AuthorizeList $authorize + * @property TokenList $token */ class V1 extends Version { - protected $_mediaProcessor; - protected $_mediaRecording; - protected $_playerStreamer; + protected $_authorize; + protected $_token; /** - * Construct the V1 version of Media + * Construct the V1 version of Oauth * * @param Domain $domain Domain that contains the version */ @@ -48,28 +42,20 @@ public function __construct(Domain $domain) $this->version = 'v1'; } - protected function getMediaProcessor(): MediaProcessorList + protected function getAuthorize(): AuthorizeList { - if (!$this->_mediaProcessor) { - $this->_mediaProcessor = new MediaProcessorList($this); + if (!$this->_authorize) { + $this->_authorize = new AuthorizeList($this); } - return $this->_mediaProcessor; + return $this->_authorize; } - protected function getMediaRecording(): MediaRecordingList + protected function getToken(): TokenList { - if (!$this->_mediaRecording) { - $this->_mediaRecording = new MediaRecordingList($this); + if (!$this->_token) { + $this->_token = new TokenList($this); } - return $this->_mediaRecording; - } - - protected function getPlayerStreamer(): PlayerStreamerList - { - if (!$this->_playerStreamer) { - $this->_playerStreamer = new PlayerStreamerList($this); - } - return $this->_playerStreamer; + return $this->_token; } /** @@ -114,6 +100,6 @@ public function __call(string $name, array $arguments): InstanceContext */ public function __toString(): string { - return '[Twilio.Media.V1]'; + return '[Twilio.Oauth.V1]'; } } diff --git a/src/Twilio/Rest/Oauth/V1/AuthorizeInstance.php b/src/Twilio/Rest/Oauth/V1/AuthorizeInstance.php new file mode 100644 index 000000000..8e586e339 --- /dev/null +++ b/src/Twilio/Rest/Oauth/V1/AuthorizeInstance.php @@ -0,0 +1,80 @@ +properties = [ + 'redirectTo' => Values::array_get($payload, 'redirect_to'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.AuthorizeInstance]'; + } +} + diff --git a/src/Twilio/Rest/Oauth/V1/AuthorizeList.php b/src/Twilio/Rest/Oauth/V1/AuthorizeList.php new file mode 100644 index 000000000..f1daf304e --- /dev/null +++ b/src/Twilio/Rest/Oauth/V1/AuthorizeList.php @@ -0,0 +1,88 @@ +solution = [ + ]; + + $this->uri = '/authorize'; + } + + /** + * Fetch the AuthorizeInstance + * + * @param array|Options $options Optional Arguments + * @return AuthorizeInstance Fetched AuthorizeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): AuthorizeInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'ResponseType' => + $options['responseType'], + 'ClientId' => + $options['clientId'], + 'RedirectUri' => + $options['redirectUri'], + 'Scope' => + $options['scope'], + 'State' => + $options['state'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params, []); + + return new AuthorizeInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.AuthorizeList]'; + } +} diff --git a/src/Twilio/Rest/Oauth/V1/AuthorizeOptions.php b/src/Twilio/Rest/Oauth/V1/AuthorizeOptions.php new file mode 100644 index 000000000..aedc514a4 --- /dev/null +++ b/src/Twilio/Rest/Oauth/V1/AuthorizeOptions.php @@ -0,0 +1,148 @@ +options['responseType'] = $responseType; + $this->options['clientId'] = $clientId; + $this->options['redirectUri'] = $redirectUri; + $this->options['scope'] = $scope; + $this->options['state'] = $state; + } + + /** + * Response Type + * + * @param string $responseType Response Type + * @return $this Fluent Builder + */ + public function setResponseType(string $responseType): self + { + $this->options['responseType'] = $responseType; + return $this; + } + + /** + * The Client Identifier + * + * @param string $clientId The Client Identifier + * @return $this Fluent Builder + */ + public function setClientId(string $clientId): self + { + $this->options['clientId'] = $clientId; + return $this; + } + + /** + * The url to which response will be redirected to + * + * @param string $redirectUri The url to which response will be redirected to + * @return $this Fluent Builder + */ + public function setRedirectUri(string $redirectUri): self + { + $this->options['redirectUri'] = $redirectUri; + return $this; + } + + /** + * The scope of the access request + * + * @param string $scope The scope of the access request + * @return $this Fluent Builder + */ + public function setScope(string $scope): self + { + $this->options['scope'] = $scope; + return $this; + } + + /** + * An opaque value which can be used to maintain state between the request and callback + * + * @param string $state An opaque value which can be used to maintain state between the request and callback + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Oauth.V1.FetchAuthorizeOptions ' . $options . ']'; + } +} + diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamerPage.php b/src/Twilio/Rest/Oauth/V1/AuthorizePage.php similarity index 76% rename from src/Twilio/Rest/Media/V1/PlayerStreamerPage.php rename to src/Twilio/Rest/Oauth/V1/AuthorizePage.php index 07fc2c598..5eb9be29c 100644 --- a/src/Twilio/Rest/Media/V1/PlayerStreamerPage.php +++ b/src/Twilio/Rest/Oauth/V1/AuthorizePage.php @@ -5,7 +5,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Media + * Twilio - Oauth * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -13,13 +13,13 @@ * Do not edit the class manually. */ -namespace Twilio\Rest\Media\V1; +namespace Twilio\Rest\Oauth\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; -class PlayerStreamerPage extends Page +class AuthorizePage extends Page { /** * @param Version $version Version that contains the resource @@ -36,11 +36,11 @@ public function __construct(Version $version, Response $response, array $solutio /** * @param array $payload Payload response from the API - * @return PlayerStreamerInstance \Twilio\Rest\Media\V1\PlayerStreamerInstance + * @return AuthorizeInstance \Twilio\Rest\Oauth\V1\AuthorizeInstance */ - public function buildInstance(array $payload): PlayerStreamerInstance + public function buildInstance(array $payload): AuthorizeInstance { - return new PlayerStreamerInstance($this->version, $payload); + return new AuthorizeInstance($this->version, $payload); } /** @@ -50,6 +50,6 @@ public function buildInstance(array $payload): PlayerStreamerInstance */ public function __toString(): string { - return '[Twilio.Media.V1.PlayerStreamerPage]'; + return '[Twilio.Oauth.V1.AuthorizePage]'; } } diff --git a/src/Twilio/Rest/Oauth/V1/TokenInstance.php b/src/Twilio/Rest/Oauth/V1/TokenInstance.php new file mode 100644 index 000000000..843817865 --- /dev/null +++ b/src/Twilio/Rest/Oauth/V1/TokenInstance.php @@ -0,0 +1,88 @@ +properties = [ + 'accessToken' => Values::array_get($payload, 'access_token'), + 'refreshToken' => Values::array_get($payload, 'refresh_token'), + 'idToken' => Values::array_get($payload, 'id_token'), + 'tokenType' => Values::array_get($payload, 'token_type'), + 'expiresIn' => Values::array_get($payload, 'expires_in'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.TokenInstance]'; + } +} + diff --git a/src/Twilio/Rest/Oauth/V1/TokenList.php b/src/Twilio/Rest/Oauth/V1/TokenList.php new file mode 100644 index 000000000..2aaca528b --- /dev/null +++ b/src/Twilio/Rest/Oauth/V1/TokenList.php @@ -0,0 +1,96 @@ +solution = [ + ]; + + $this->uri = '/token'; + } + + /** + * Create the TokenInstance + * + * @param string $grantType Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + * @param string $clientId A 34 character string that uniquely identifies this OAuth App. + * @param array|Options $options Optional Arguments + * @return TokenInstance Created TokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $grantType, string $clientId, array $options = []): TokenInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'GrantType' => + $grantType, + 'ClientId' => + $clientId, + 'ClientSecret' => + $options['clientSecret'], + 'Code' => + $options['code'], + 'RedirectUri' => + $options['redirectUri'], + 'Audience' => + $options['audience'], + 'RefreshToken' => + $options['refreshToken'], + 'Scope' => + $options['scope'], + ]); + + $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]'; + } +} diff --git a/src/Twilio/Rest/Oauth/V1/TokenOptions.php b/src/Twilio/Rest/Oauth/V1/TokenOptions.php new file mode 100644 index 000000000..6db0240b4 --- /dev/null +++ b/src/Twilio/Rest/Oauth/V1/TokenOptions.php @@ -0,0 +1,166 @@ +options['clientSecret'] = $clientSecret; + $this->options['code'] = $code; + $this->options['redirectUri'] = $redirectUri; + $this->options['audience'] = $audience; + $this->options['refreshToken'] = $refreshToken; + $this->options['scope'] = $scope; + } + + /** + * The credential for confidential OAuth App. + * + * @param string $clientSecret The credential for confidential OAuth App. + * @return $this Fluent Builder + */ + public function setClientSecret(string $clientSecret): self + { + $this->options['clientSecret'] = $clientSecret; + return $this; + } + + /** + * JWT token related to the authorization code grant type. + * + * @param string $code JWT token related to the authorization code grant type. + * @return $this Fluent Builder + */ + public function setCode(string $code): self + { + $this->options['code'] = $code; + return $this; + } + + /** + * The redirect uri + * + * @param string $redirectUri The redirect uri + * @return $this Fluent Builder + */ + public function setRedirectUri(string $redirectUri): self + { + $this->options['redirectUri'] = $redirectUri; + return $this; + } + + /** + * The targeted audience uri + * + * @param string $audience The targeted audience uri + * @return $this Fluent Builder + */ + public function setAudience(string $audience): self + { + $this->options['audience'] = $audience; + return $this; + } + + /** + * JWT token related to refresh access token. + * + * @param string $refreshToken JWT token related to refresh access token. + * @return $this Fluent Builder + */ + public function setRefreshToken(string $refreshToken): self + { + $this->options['refreshToken'] = $refreshToken; + return $this; + } + + /** + * The scope of token + * + * @param string $scope The scope of token + * @return $this Fluent Builder + */ + public function setScope(string $scope): self + { + $this->options['scope'] = $scope; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Oauth.V1.CreateTokenOptions ' . $options . ']'; + } +} + diff --git a/src/Twilio/Rest/Media/V1/MediaRecordingPage.php b/src/Twilio/Rest/Oauth/V1/TokenPage.php similarity index 76% rename from src/Twilio/Rest/Media/V1/MediaRecordingPage.php rename to src/Twilio/Rest/Oauth/V1/TokenPage.php index 53f8d9948..53ebc5e33 100644 --- a/src/Twilio/Rest/Media/V1/MediaRecordingPage.php +++ b/src/Twilio/Rest/Oauth/V1/TokenPage.php @@ -5,7 +5,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Media + * Twilio - Oauth * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -13,13 +13,13 @@ * Do not edit the class manually. */ -namespace Twilio\Rest\Media\V1; +namespace Twilio\Rest\Oauth\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; -class MediaRecordingPage extends Page +class TokenPage extends Page { /** * @param Version $version Version that contains the resource @@ -36,11 +36,11 @@ public function __construct(Version $version, Response $response, array $solutio /** * @param array $payload Payload response from the API - * @return MediaRecordingInstance \Twilio\Rest\Media\V1\MediaRecordingInstance + * @return TokenInstance \Twilio\Rest\Oauth\V1\TokenInstance */ - public function buildInstance(array $payload): MediaRecordingInstance + public function buildInstance(array $payload): TokenInstance { - return new MediaRecordingInstance($this->version, $payload); + return new TokenInstance($this->version, $payload); } /** @@ -50,6 +50,6 @@ public function buildInstance(array $payload): MediaRecordingInstance */ public function __toString(): string { - return '[Twilio.Media.V1.MediaRecordingPage]'; + return '[Twilio.Oauth.V1.TokenPage]'; } } diff --git a/src/Twilio/Rest/MediaBase.php b/src/Twilio/Rest/OauthBase.php similarity index 89% rename from src/Twilio/Rest/MediaBase.php rename to src/Twilio/Rest/OauthBase.php index c4003cab6..f056693cf 100644 --- a/src/Twilio/Rest/MediaBase.php +++ b/src/Twilio/Rest/OauthBase.php @@ -14,28 +14,28 @@ use Twilio\Domain; use Twilio\Exceptions\TwilioException; -use Twilio\Rest\Media\V1; +use Twilio\Rest\Oauth\V1; /** - * @property \Twilio\Rest\Media\V1 $v1 + * @property \Twilio\Rest\Oauth\V1 $v1 */ -class MediaBase extends Domain { +class OauthBase extends Domain { protected $_v1; /** - * Construct the Media Domain + * Construct the Oauth Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); - $this->baseUrl = 'https://media.twilio.com'; + $this->baseUrl = 'https://oauth.twilio.com'; } /** - * @return V1 Version v1 of media + * @return V1 Version v1 of oauth */ protected function getV1(): V1 { if (!$this->_v1) { @@ -83,6 +83,6 @@ public function __call(string $name, array $arguments) { * @return string Machine friendly representation */ public function __toString(): string { - return '[Twilio.Media]'; + return '[Twilio.Oauth]'; } } diff --git a/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php b/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php index 49a2f8560..34e3f8e08 100644 --- a/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php +++ b/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): CertificateInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CertificateInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php b/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php index 0f67aa279..9525c2fac 100644 --- a/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php +++ b/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): DeploymentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeploymentInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php b/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php index 8ebcaca67..ce92394c8 100644 --- a/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php +++ b/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): DeviceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeviceInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php b/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php index f22774297..abf13ccf0 100644 --- a/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php +++ b/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): KeyInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new KeyInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php b/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php index 7df3c7e83..f691916d1 100644 --- a/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php +++ b/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php @@ -90,7 +90,7 @@ public function delete(): bool public function fetch(): FleetInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FleetInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php b/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php index 0426f3837..b47913218 100644 --- a/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php +++ b/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): AuthorizationDocumentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthorizationDocumentInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php b/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php index f7fb78b17..c5c9d14d1 100644 --- a/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php +++ b/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): HostedNumberOrderInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new HostedNumberOrderInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php b/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php index 1c4d6c9b4..cb0ede7a2 100644 --- a/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php +++ b/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): AvailableAddOnExtensionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AvailableAddOnExtensionInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php b/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php index 90d44eae4..0f59768e7 100644 --- a/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php +++ b/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php @@ -63,7 +63,7 @@ public function __construct( public function fetch(): AvailableAddOnInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AvailableAddOnInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php index c75dbd642..d8e538fb9 100644 --- a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php +++ b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php @@ -62,7 +62,7 @@ public function __construct( public function fetch(): InstalledAddOnExtensionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InstalledAddOnExtensionInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php index 8fd2d405f..990ba1d09 100644 --- a/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php +++ b/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php @@ -79,7 +79,7 @@ public function delete(): bool public function fetch(): InstalledAddOnInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InstalledAddOnInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php b/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php index f461587c5..ecc984db0 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php +++ b/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): DocumentPermissionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DocumentPermissionInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php b/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php index 7b36034b9..856f1d925 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php +++ b/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php @@ -84,7 +84,7 @@ public function delete(): bool public function fetch(): DocumentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DocumentInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php index 719ba130c..5d0c743ac 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): SyncListItemInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListItemInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php index d34bd42e7..f187b2215 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): SyncListPermissionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListPermissionInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php b/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php index f5073946f..c8495a9bc 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php @@ -85,7 +85,7 @@ public function delete(): bool public function fetch(): SyncListInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php index b8e64c3c1..1ae42a69c 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): SyncMapItemInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapItemInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php index 1955c5807..8f9ca27ff 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): SyncMapPermissionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapPermissionInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php b/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php index 77ce832d5..77970f3a5 100644 --- a/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php +++ b/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php @@ -85,7 +85,7 @@ public function delete(): bool public function fetch(): SyncMapInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Sync/ServiceContext.php b/src/Twilio/Rest/Preview/Sync/ServiceContext.php index 64aac80cc..6ed8440ce 100644 --- a/src/Twilio/Rest/Preview/Sync/ServiceContext.php +++ b/src/Twilio/Rest/Preview/Sync/ServiceContext.php @@ -87,7 +87,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Wireless/CommandContext.php b/src/Twilio/Rest/Preview/Wireless/CommandContext.php index fb41a41ab..5b279328d 100644 --- a/src/Twilio/Rest/Preview/Wireless/CommandContext.php +++ b/src/Twilio/Rest/Preview/Wireless/CommandContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): CommandInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CommandInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php b/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php index 3f6c0bd63..3fb600961 100644 --- a/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php +++ b/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php @@ -70,7 +70,7 @@ public function delete(): bool public function fetch(): RatePlanInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RatePlanInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php b/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php index a55c79270..e8b1a8af0 100644 --- a/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php +++ b/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php @@ -67,7 +67,7 @@ public function fetch(array $options = []): UsageInstance $options['start'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new UsageInstance( $this->version, diff --git a/src/Twilio/Rest/Preview/Wireless/SimContext.php b/src/Twilio/Rest/Preview/Wireless/SimContext.php index ba7641621..e1acc17f7 100644 --- a/src/Twilio/Rest/Preview/Wireless/SimContext.php +++ b/src/Twilio/Rest/Preview/Wireless/SimContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): SimInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SimInstance( $this->version, diff --git a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastInstance.php b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastInstance.php index 7882435c6..9b5eeeb64 100644 --- a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastInstance.php +++ b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastInstance.php @@ -18,16 +18,10 @@ namespace Twilio\Rest\PreviewMessaging\V1; use Twilio\Exceptions\TwilioException; -use Twilio\ListResource; use Twilio\InstanceResource; -use Twilio\Options; -use Twilio\Stream; use Twilio\Values; use Twilio\Version; -use Twilio\InstanceContext; use Twilio\Deserialize; -use Twilio\Serialize; -use Twilio\Base\PhoneNumberCapabilities; /** diff --git a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastList.php b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastList.php index 650c7f4ca..46154bd26 100644 --- a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastList.php +++ b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastList.php @@ -18,15 +18,9 @@ use Twilio\Exceptions\TwilioException; use Twilio\ListResource; -use Twilio\InstanceResource; use Twilio\Options; -use Twilio\Stream; use Twilio\Values; use Twilio\Version; -use Twilio\InstanceContext; -use Twilio\Deserialize; -use Twilio\Serialize; -use Twilio\Base\PhoneNumberCapabilities; class BroadcastList extends ListResource diff --git a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastOptions.php b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastOptions.php index 8eb35e034..e8ee72576 100644 --- a/src/Twilio/Rest/PreviewMessaging/V1/BroadcastOptions.php +++ b/src/Twilio/Rest/PreviewMessaging/V1/BroadcastOptions.php @@ -15,17 +15,8 @@ namespace Twilio\Rest\PreviewMessaging\V1; -use Twilio\Exceptions\TwilioException; -use Twilio\ListResource; -use Twilio\InstanceResource; use Twilio\Options; -use Twilio\Stream; use Twilio\Values; -use Twilio\Version; -use Twilio\InstanceContext; -use Twilio\Deserialize; -use Twilio\Serialize; -use Twilio\Base\PhoneNumberCapabilities; abstract class BroadcastOptions { diff --git a/src/Twilio/Rest/PreviewMessaging/V1/MessageInstance.php b/src/Twilio/Rest/PreviewMessaging/V1/MessageInstance.php index ed424ac86..aec07a58d 100644 --- a/src/Twilio/Rest/PreviewMessaging/V1/MessageInstance.php +++ b/src/Twilio/Rest/PreviewMessaging/V1/MessageInstance.php @@ -18,16 +18,9 @@ namespace Twilio\Rest\PreviewMessaging\V1; use Twilio\Exceptions\TwilioException; -use Twilio\ListResource; use Twilio\InstanceResource; -use Twilio\Options; -use Twilio\Stream; use Twilio\Values; use Twilio\Version; -use Twilio\InstanceContext; -use Twilio\Deserialize; -use Twilio\Serialize; -use Twilio\Base\PhoneNumberCapabilities; /** diff --git a/src/Twilio/Rest/PreviewMessaging/V1/MessageList.php b/src/Twilio/Rest/PreviewMessaging/V1/MessageList.php index 83d982386..829a6b6d3 100644 --- a/src/Twilio/Rest/PreviewMessaging/V1/MessageList.php +++ b/src/Twilio/Rest/PreviewMessaging/V1/MessageList.php @@ -18,15 +18,7 @@ use Twilio\Exceptions\TwilioException; use Twilio\ListResource; -use Twilio\InstanceResource; -use Twilio\Options; -use Twilio\Stream; -use Twilio\Values; use Twilio\Version; -use Twilio\InstanceContext; -use Twilio\Deserialize; -use Twilio\Serialize; -use Twilio\Base\PhoneNumberCapabilities; class MessageList extends ListResource diff --git a/src/Twilio/Rest/PreviewMessagingBase.php b/src/Twilio/Rest/PreviewMessagingBase.php index 10588b31c..b584e03e4 100644 --- a/src/Twilio/Rest/PreviewMessagingBase.php +++ b/src/Twilio/Rest/PreviewMessagingBase.php @@ -35,7 +35,7 @@ public function __construct(Client $client) { /** - * @return V1 Version v1 of PreviewMessaging + * @return V1 Version v1 of preview.messaging */ protected function getV1(): V1 { if (!$this->_v1) { diff --git a/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php b/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php index 762961a1a..96f3eb058 100644 --- a/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php +++ b/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): CountryInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, diff --git a/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php b/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php index 7154d767c..0fbccd4df 100644 --- a/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php +++ b/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): CountryInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, diff --git a/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php b/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php index 33814b722..b0b47271c 100644 --- a/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php +++ b/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): CountryInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, diff --git a/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php b/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php index 03d75ace1..eb15140ee 100644 --- a/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php +++ b/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): NumberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new NumberInstance( $this->version, diff --git a/src/Twilio/Rest/Pricing/V2/CountryContext.php b/src/Twilio/Rest/Pricing/V2/CountryContext.php index 372a4e6d0..dea05adb8 100644 --- a/src/Twilio/Rest/Pricing/V2/CountryContext.php +++ b/src/Twilio/Rest/Pricing/V2/CountryContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): CountryInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, diff --git a/src/Twilio/Rest/Pricing/V2/NumberContext.php b/src/Twilio/Rest/Pricing/V2/NumberContext.php index e0a809879..d6b59d1d4 100644 --- a/src/Twilio/Rest/Pricing/V2/NumberContext.php +++ b/src/Twilio/Rest/Pricing/V2/NumberContext.php @@ -65,7 +65,7 @@ public function fetch(array $options = []): NumberInstance $options['originationNumber'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new NumberInstance( $this->version, diff --git a/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php b/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php index 0e1d2ba4e..d4eec82a7 100644 --- a/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php +++ b/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): CountryInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, diff --git a/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php b/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php index 7b08c4e12..fe26db566 100644 --- a/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php +++ b/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php @@ -65,7 +65,7 @@ public function fetch(array $options = []): NumberInstance $options['originationNumber'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new NumberInstance( $this->version, diff --git a/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php b/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php index bb8529b9c..c100ef81c 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php +++ b/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): PhoneNumberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PhoneNumberInstance( $this->version, diff --git a/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php b/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php index 4f6772b4e..9e3ff1e13 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php +++ b/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): InteractionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new InteractionInstance( $this->version, diff --git a/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php b/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php index 609f0985b..0abdfb397 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php +++ b/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php @@ -70,7 +70,7 @@ public function __construct( public function fetch(): MessageInteractionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInteractionInstance( $this->version, diff --git a/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php b/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php index b84f5a6df..7fe8fd503 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php +++ b/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): ParticipantInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, diff --git a/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php b/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php index bfc520729..6d4163015 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php +++ b/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php @@ -88,7 +88,7 @@ public function delete(): bool public function fetch(): SessionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SessionInstance( $this->version, diff --git a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php index cb73bf4f1..f4b438338 100644 --- a/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php +++ b/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): ShortCodeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ShortCodeInstance( $this->version, diff --git a/src/Twilio/Rest/Proxy/V1/ServiceContext.php b/src/Twilio/Rest/Proxy/V1/ServiceContext.php index 0a00c87cb..2034df5ab 100644 --- a/src/Twilio/Rest/Proxy/V1/ServiceContext.php +++ b/src/Twilio/Rest/Proxy/V1/ServiceContext.php @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php b/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php index d04697c32..079e9824c 100644 --- a/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php +++ b/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php @@ -57,7 +57,7 @@ public function __construct( public function fetch(): PhoneNumberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PhoneNumberInstance( $this->version, diff --git a/src/Twilio/Rest/Routes/V2/SipDomainContext.php b/src/Twilio/Rest/Routes/V2/SipDomainContext.php index 7fdb3884b..d3d81efdc 100644 --- a/src/Twilio/Rest/Routes/V2/SipDomainContext.php +++ b/src/Twilio/Rest/Routes/V2/SipDomainContext.php @@ -57,7 +57,7 @@ public function __construct( public function fetch(): SipDomainInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SipDomainInstance( $this->version, diff --git a/src/Twilio/Rest/Routes/V2/TrunkContext.php b/src/Twilio/Rest/Routes/V2/TrunkContext.php index 08b70a017..832b6a065 100644 --- a/src/Twilio/Rest/Routes/V2/TrunkContext.php +++ b/src/Twilio/Rest/Routes/V2/TrunkContext.php @@ -57,7 +57,7 @@ public function __construct( public function fetch(): TrunkInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrunkInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php b/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php index dc0c1e1f4..25b29cbeb 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): AssetVersionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AssetVersionInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php b/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php index 53a584cb4..a17f25faa 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php @@ -82,7 +82,7 @@ public function delete(): bool public function fetch(): AssetInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AssetInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php b/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php index f719afe1a..6b8e628ef 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): BuildStatusInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BuildStatusInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php b/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php index 4044ef91d..b3ffc48f1 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php @@ -81,7 +81,7 @@ public function delete(): bool public function fetch(): BuildInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BuildInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php b/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php index c7ea12d5c..c2ca65e01 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): DeploymentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeploymentInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php b/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php index b166d9146..de629a195 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): LogInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new LogInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php b/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php index 8c1d1e5d2..263ad1b3f 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): VariableInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new VariableInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php b/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php index eb8de753f..cf910937d 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php @@ -89,7 +89,7 @@ public function delete(): bool public function fetch(): EnvironmentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EnvironmentInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php b/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php index c092f7f75..59fa138d6 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php @@ -82,7 +82,7 @@ public function delete(): bool public function fetch(): FunctionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FunctionInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php b/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php index cccb72635..b1b093b99 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): FunctionVersionContentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FunctionVersionContentInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php b/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php index ba773832c..a36d3324d 100644 --- a/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php +++ b/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php @@ -73,7 +73,7 @@ public function __construct( public function fetch(): FunctionVersionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FunctionVersionInstance( $this->version, diff --git a/src/Twilio/Rest/Serverless/V1/ServiceContext.php b/src/Twilio/Rest/Serverless/V1/ServiceContext.php index bf42ab27d..06e13a808 100644 --- a/src/Twilio/Rest/Serverless/V1/ServiceContext.php +++ b/src/Twilio/Rest/Serverless/V1/ServiceContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php b/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php index 4402573c4..fbb72ff8b 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php +++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): EngagementContextInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EngagementContextInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php b/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php index f8d718522..0d53cd41f 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php +++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): StepContextInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new StepContextInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php b/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php index 916e7a83f..37e3f9fea 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php +++ b/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php @@ -73,7 +73,7 @@ public function __construct( public function fetch(): StepInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new StepInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php b/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php index fcc5b48e2..eff69b81c 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php +++ b/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php @@ -85,7 +85,7 @@ public function delete(): bool public function fetch(): EngagementInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EngagementInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php index a698b1692..651c2a9e3 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php +++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): ExecutionContextInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionContextInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php index 16d7c91ec..abc9d37d5 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php +++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): ExecutionStepContextInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionStepContextInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php index c89a3061a..50884b58b 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php +++ b/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php @@ -73,7 +73,7 @@ public function __construct( public function fetch(): ExecutionStepInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionStepInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php b/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php index 52d57ac78..7eb970928 100644 --- a/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php +++ b/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): ExecutionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V1/FlowContext.php b/src/Twilio/Rest/Studio/V1/FlowContext.php index a62fe03fb..77668c00c 100644 --- a/src/Twilio/Rest/Studio/V1/FlowContext.php +++ b/src/Twilio/Rest/Studio/V1/FlowContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): FlowInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlowInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php index e11d00918..574184d36 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php +++ b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): ExecutionContextInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionContextInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php index 8249ab323..2590d24aa 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php +++ b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): ExecutionStepContextInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionStepContextInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php index f11d875e1..cf84402e5 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php +++ b/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php @@ -73,7 +73,7 @@ public function __construct( public function fetch(): ExecutionStepInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionStepInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php b/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php index e051af192..79dfddff0 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php +++ b/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): ExecutionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php b/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php index 460723d6a..0622460b2 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php +++ b/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): FlowRevisionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlowRevisionInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php b/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php index 135831787..407e43e68 100644 --- a/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php +++ b/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php @@ -57,7 +57,7 @@ public function __construct( public function fetch(): FlowTestUserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlowTestUserInstance( $this->version, diff --git a/src/Twilio/Rest/Studio/V2/FlowContext.php b/src/Twilio/Rest/Studio/V2/FlowContext.php index d8520d504..676d8137b 100644 --- a/src/Twilio/Rest/Studio/V2/FlowContext.php +++ b/src/Twilio/Rest/Studio/V2/FlowContext.php @@ -87,7 +87,7 @@ public function delete(): bool public function fetch(): FlowInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlowInstance( $this->version, diff --git a/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php b/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php index 66cce70be..faa0dca2f 100644 --- a/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php +++ b/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): EsimProfileInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EsimProfileInstance( $this->version, diff --git a/src/Twilio/Rest/Supersim/V1/FleetContext.php b/src/Twilio/Rest/Supersim/V1/FleetContext.php index 86c3b90f2..6c9d499b3 100644 --- a/src/Twilio/Rest/Supersim/V1/FleetContext.php +++ b/src/Twilio/Rest/Supersim/V1/FleetContext.php @@ -57,7 +57,7 @@ public function __construct( public function fetch(): FleetInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FleetInstance( $this->version, diff --git a/src/Twilio/Rest/Supersim/V1/IpCommandContext.php b/src/Twilio/Rest/Supersim/V1/IpCommandContext.php index 13e6fba5e..f8559ba74 100644 --- a/src/Twilio/Rest/Supersim/V1/IpCommandContext.php +++ b/src/Twilio/Rest/Supersim/V1/IpCommandContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): IpCommandInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpCommandInstance( $this->version, diff --git a/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php b/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php index 310942761..8835bdc16 100644 --- a/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php +++ b/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): NetworkAccessProfileNetworkInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new NetworkAccessProfileNetworkInstance( $this->version, diff --git a/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php b/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php index 0c18d7263..0dc0dcff8 100644 --- a/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php +++ b/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): NetworkAccessProfileInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new NetworkAccessProfileInstance( $this->version, diff --git a/src/Twilio/Rest/Supersim/V1/NetworkContext.php b/src/Twilio/Rest/Supersim/V1/NetworkContext.php index 1542eb6af..ecadbf214 100644 --- a/src/Twilio/Rest/Supersim/V1/NetworkContext.php +++ b/src/Twilio/Rest/Supersim/V1/NetworkContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): NetworkInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new NetworkInstance( $this->version, diff --git a/src/Twilio/Rest/Supersim/V1/SimContext.php b/src/Twilio/Rest/Supersim/V1/SimContext.php index 131b41d26..34b29c7b9 100644 --- a/src/Twilio/Rest/Supersim/V1/SimContext.php +++ b/src/Twilio/Rest/Supersim/V1/SimContext.php @@ -67,7 +67,7 @@ public function __construct( public function fetch(): SimInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SimInstance( $this->version, diff --git a/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php b/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php index 5ed50c9f6..f9130e941 100644 --- a/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php +++ b/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): SmsCommandInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SmsCommandInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php b/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php index d30b264e4..ca52553a5 100644 --- a/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): DocumentPermissionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DocumentPermissionInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php b/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php index 24c58fa80..766854e80 100644 --- a/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php @@ -84,7 +84,7 @@ public function delete(): bool public function fetch(): DocumentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new DocumentInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php index eda0a1276..22c3117ec 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): SyncListItemInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListItemInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php index 8e15e6b62..852a64d77 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): SyncListPermissionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListPermissionInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php b/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php index 243b7d2f5..bc4f016f4 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php @@ -87,7 +87,7 @@ public function delete(): bool public function fetch(): SyncListInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php index 4a6e13adc..674b18c84 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php @@ -86,7 +86,7 @@ public function delete(array $options = []): bool public function fetch(): SyncMapItemInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapItemInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php index 649fd7c3b..4a2ea8899 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): SyncMapPermissionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapPermissionInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php b/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php index c17425217..df2bcd2c6 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php @@ -87,7 +87,7 @@ public function delete(): bool public function fetch(): SyncMapInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php b/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php index 716c8f1fe..177ee892f 100644 --- a/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php +++ b/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php @@ -83,7 +83,7 @@ public function delete(): bool public function fetch(): SyncStreamInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncStreamInstance( $this->version, diff --git a/src/Twilio/Rest/Sync/V1/ServiceContext.php b/src/Twilio/Rest/Sync/V1/ServiceContext.php index dba0e93d8..e44bf06e1 100644 --- a/src/Twilio/Rest/Sync/V1/ServiceContext.php +++ b/src/Twilio/Rest/Sync/V1/ServiceContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php index b74e53ba1..1a139b934 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php @@ -75,7 +75,7 @@ public function delete(): bool public function fetch(): ActivityInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ActivityInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php index 74c315652..a04f08979 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): EventInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EventInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php index a1b2d83fd..8d4e0a120 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php @@ -68,7 +68,7 @@ public function __construct( public function fetch(): ReservationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ReservationInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php index 8e7d40845..70b570c4c 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): TaskChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TaskChannelInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php index 4e33414f9..859f30f33 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php @@ -89,7 +89,7 @@ public function delete(array $options = []): bool public function fetch(): TaskInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TaskInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsInstance.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsInstance.php new file mode 100644 index 000000000..2e48360bb --- /dev/null +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'taskQueueData' => Values::array_get($payload, 'task_queue_data'), + 'taskQueueResponseCount' => Values::array_get($payload, 'task_queue_response_count'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsInstance]'; + } +} + diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsList.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsList.php new file mode 100644 index 000000000..4348d9156 --- /dev/null +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsList.php @@ -0,0 +1,79 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/RealTimeStatistics'; + } + + /** + * Create the TaskQueueBulkRealTimeStatisticsInstance + * + * @return TaskQueueBulkRealTimeStatisticsInstance Created TaskQueueBulkRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): TaskQueueBulkRealTimeStatisticsInstance + { + + $data = $body->toArray(); + $headers['Content-Type'] = 'application/json'; + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new TaskQueueBulkRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsList]'; + } +} diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsPage.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsPage.php new file mode 100644 index 000000000..3a9f05275 --- /dev/null +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueBulkRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueBulkRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueBulkRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueueBulkRealTimeStatisticsInstance + { + return new TaskQueueBulkRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsPage]'; + } +} diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php index edceb4c94..a807bfd90 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php @@ -79,7 +79,7 @@ public function fetch(array $options = []): TaskQueueCumulativeStatisticsInstanc $options['splitByWaitTime'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new TaskQueueCumulativeStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php index a1e824682..c04cf9000 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php @@ -70,7 +70,7 @@ public function fetch(array $options = []): TaskQueueRealTimeStatisticsInstance $options['taskChannel'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new TaskQueueRealTimeStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php index 311197769..00f576402 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php @@ -79,7 +79,7 @@ public function fetch(array $options = []): TaskQueueStatisticsInstance $options['splitByWaitTime'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new TaskQueueStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php index 16ff3a7d1..b73efc8d7 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): TaskQueueInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TaskQueueInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php index 9017d8710..653228c57 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php @@ -23,18 +23,18 @@ use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; -use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueBulkRealTimeStatisticsList; +use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsList; /** - * @property TaskQueuesStatisticsList $statistics * @property TaskQueueBulkRealTimeStatisticsList $bulkRealTimeStatistics + * @property TaskQueuesStatisticsList $statistics */ class TaskQueueList extends ListResource { - protected $_statistics = null; protected $_bulkRealTimeStatistics = null; + protected $_statistics = null; /** * Construct the TaskQueueList @@ -219,31 +219,31 @@ public function getContext( } /** - * Access the statistics + * Access the bulkRealTimeStatistics */ - protected function getStatistics(): TaskQueuesStatisticsList + protected function getBulkRealTimeStatistics(): TaskQueueBulkRealTimeStatisticsList { - if (!$this->_statistics) { - $this->_statistics = new TaskQueuesStatisticsList( + if (!$this->_bulkRealTimeStatistics) { + $this->_bulkRealTimeStatistics = new TaskQueueBulkRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'] ); } - return $this->_statistics; + return $this->_bulkRealTimeStatistics; } /** - * Access the bulkRealTimeStatistics + * Access the statistics */ - protected function getBulkRealTimeStatistics(): TaskQueueBulkRealTimeStatisticsList + protected function getStatistics(): TaskQueuesStatisticsList { - if (!$this->_bulkRealTimeStatistics) { - $this->_bulkRealTimeStatistics = new TaskQueueBulkRealTimeStatisticsList( + if (!$this->_statistics) { + $this->_statistics = new TaskQueuesStatisticsList( $this->version, $this->solution['workspaceSid'] ); } - return $this->_bulkRealTimeStatistics; + return $this->_statistics; } /** diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php index c3372370f..c939e6503 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php @@ -68,7 +68,7 @@ public function __construct( public function fetch(): ReservationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ReservationInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php index ab587233e..825cf11d0 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php @@ -68,7 +68,7 @@ public function __construct( public function fetch(): WorkerChannelInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WorkerChannelInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php index d6f7d3fb3..cefb19712 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php @@ -77,7 +77,7 @@ public function fetch(array $options = []): WorkerStatisticsInstance $options['taskChannel'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkerStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php index 08350361e..4057e53ee 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php @@ -72,7 +72,7 @@ public function fetch(array $options = []): WorkersCumulativeStatisticsInstance $options['taskChannel'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkersCumulativeStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php index 97e565a77..bb165e16e 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php @@ -65,7 +65,7 @@ public function fetch(array $options = []): WorkersRealTimeStatisticsInstance $options['taskChannel'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkersRealTimeStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php index 469fb4b7e..af384ddf2 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php @@ -78,7 +78,7 @@ public function fetch(array $options = []): WorkersStatisticsInstance $options['taskChannel'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkersStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php index 9f437a652..d87c58b10 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php @@ -105,7 +105,7 @@ public function delete(array $options = []): bool public function fetch(): WorkerInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WorkerInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php index 413b1bc57..9b58d9163 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php @@ -79,7 +79,7 @@ public function fetch(array $options = []): WorkflowCumulativeStatisticsInstance $options['splitByWaitTime'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkflowCumulativeStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php index cf4798ee5..06c0ec27f 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php @@ -70,7 +70,7 @@ public function fetch(array $options = []): WorkflowRealTimeStatisticsInstance $options['taskChannel'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkflowRealTimeStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php index d95621dc2..0bf9c6d96 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php @@ -79,7 +79,7 @@ public function fetch(array $options = []): WorkflowStatisticsInstance $options['splitByWaitTime'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkflowStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php index acce9dae3..add306287 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php @@ -91,7 +91,7 @@ public function delete(): bool public function fetch(): WorkflowInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WorkflowInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php index c52e22906..a0fc65999 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php @@ -74,7 +74,7 @@ public function fetch(array $options = []): WorkspaceCumulativeStatisticsInstanc $options['splitByWaitTime'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkspaceCumulativeStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php index 14e308395..c6b4ae021 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php @@ -65,7 +65,7 @@ public function fetch(array $options = []): WorkspaceRealTimeStatisticsInstance $options['taskChannel'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkspaceRealTimeStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php index a0edbf30f..19505d75c 100644 --- a/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php @@ -74,7 +74,7 @@ public function fetch(array $options = []): WorkspaceStatisticsInstance $options['splitByWaitTime'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new WorkspaceStatisticsInstance( $this->version, diff --git a/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php b/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php index 13202222b..5e109216b 100644 --- a/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php +++ b/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php @@ -115,7 +115,7 @@ public function delete(): bool public function fetch(): WorkspaceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WorkspaceInstance( $this->version, diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php b/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php index 31e7797df..4d1e73d65 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php +++ b/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): CredentialListInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialListInstance( $this->version, diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php b/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php index b6d71e76e..a5c8136a6 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php +++ b/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): IpAccessControlListInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpAccessControlListInstance( $this->version, diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php b/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php index 25f2ad9d2..bb3ac6f39 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php +++ b/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): OriginationUrlInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new OriginationUrlInstance( $this->version, diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php b/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php index 50ca5b5ff..b5100a210 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php +++ b/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): PhoneNumberInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PhoneNumberInstance( $this->version, diff --git a/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php b/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php index 7e53fb2e7..2ab2e6e61 100644 --- a/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php +++ b/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php @@ -57,7 +57,7 @@ public function __construct( public function fetch(): RecordingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingInstance( $this->version, diff --git a/src/Twilio/Rest/Trunking/V1/TrunkContext.php b/src/Twilio/Rest/Trunking/V1/TrunkContext.php index 72ea71dd6..0b8cf4711 100644 --- a/src/Twilio/Rest/Trunking/V1/TrunkContext.php +++ b/src/Twilio/Rest/Trunking/V1/TrunkContext.php @@ -95,7 +95,7 @@ public function delete(): bool public function fetch(): TrunkInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrunkInstance( $this->version, diff --git a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantContext.php b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesContext.php similarity index 50% rename from src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantContext.php rename to src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesContext.php index de8942ba5..f9cb6a47d 100644 --- a/src/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantContext.php +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesContext.php @@ -6,7 +6,7 @@ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * - * Twilio - Media + * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. @@ -15,83 +15,65 @@ */ -namespace Twilio\Rest\Media\V1\PlayerStreamer; +namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; +use Twilio\Serialize; -class PlaybackGrantContext extends InstanceContext +class ComplianceRegistrationInquiriesContext extends InstanceContext { /** - * Initialize the PlaybackGrantContext + * Initialize the ComplianceRegistrationInquiriesContext * * @param Version $version Version that contains the resource - * @param string $sid The unique string generated to identify the PlayerStreamer resource associated with this PlaybackGrant + * @param string $registrationId The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. */ public function __construct( Version $version, - $sid + $registrationId ) { parent::__construct($version); // Path Solution $this->solution = [ - 'sid' => - $sid, + 'registrationId' => + $registrationId, ]; - $this->uri = '/PlayerStreamers/' . \rawurlencode($sid) - .'/PlaybackGrant'; + $this->uri = '/ComplianceInquiries/Registration/' . \rawurlencode($registrationId) + .'/RegulatoryCompliance/GB/Initialize'; } /** - * Create the PlaybackGrantInstance + * Update the ComplianceRegistrationInquiriesInstance * * @param array|Options $options Optional Arguments - * @return PlaybackGrantInstance Created PlaybackGrantInstance + * @return ComplianceRegistrationInquiriesInstance Updated ComplianceRegistrationInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ - public function create(array $options = []): PlaybackGrantInstance + public function update(array $options = []): ComplianceRegistrationInquiriesInstance { $options = new Values($options); $data = Values::of([ - 'Ttl' => - $options['ttl'], - 'AccessControlAllowOrigin' => - $options['accessControlAllowOrigin'], + 'IsIsvEmbed' => + Serialize::booleanToString($options['isIsvEmbed']), + 'ThemeSetId' => + $options['themeSetId'], ]); - $payload = $this->version->create('POST', $this->uri, [], $data); + $payload = $this->version->update('POST', $this->uri, [], $data); - return new PlaybackGrantInstance( + return new ComplianceRegistrationInquiriesInstance( $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'] + $this->solution['registrationId'] ); } @@ -107,6 +89,6 @@ public function __toString(): string foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } - return '[Twilio.Media.V1.PlaybackGrantContext ' . \implode(' ', $context) . ']'; + return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesContext ' . \implode(' ', $context) . ']'; } } diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesInstance.php b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesInstance.php index 287b359df..f0566ce55 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesInstance.php +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesInstance.php @@ -19,6 +19,7 @@ use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; +use Twilio\Options; use Twilio\Values; use Twilio\Version; @@ -36,8 +37,9 @@ class ComplianceRegistrationInquiriesInstance extends InstanceResource * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload + * @param string $registrationId The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. */ - public function __construct(Version $version, array $payload) + public function __construct(Version $version, array $payload, string $registrationId = null) { parent::__construct($version); @@ -49,7 +51,38 @@ public function __construct(Version $version, array $payload) 'url' => Values::array_get($payload, 'url'), ]; - $this->solution = []; + $this->solution = ['registrationId' => $registrationId ?: $this->properties['registrationId'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ComplianceRegistrationInquiriesContext Context for this ComplianceRegistrationInquiriesInstance + */ + protected function proxy(): ComplianceRegistrationInquiriesContext + { + if (!$this->context) { + $this->context = new ComplianceRegistrationInquiriesContext( + $this->version, + $this->solution['registrationId'] + ); + } + + return $this->context; + } + + /** + * Update the ComplianceRegistrationInquiriesInstance + * + * @param array|Options $options Optional Arguments + * @return ComplianceRegistrationInquiriesInstance Updated ComplianceRegistrationInquiriesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ComplianceRegistrationInquiriesInstance + { + + return $this->proxy()->update($options); } /** @@ -80,7 +113,11 @@ public function __get(string $name) */ public function __toString(): string { - return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesInstance]'; + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesInstance ' . \implode(' ', $context) . ']'; } } diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesList.php b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesList.php index c60ef3b61..1f940130c 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesList.php +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesList.php @@ -134,6 +134,8 @@ public function create(string $endUserType, string $phoneNumberType, array $opti $options['isvRegisteringForSelfOrTenant'], 'StatusCallbackUrl' => $options['statusCallbackUrl'], + 'ThemeSetId' => + $options['themeSetId'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); @@ -145,6 +147,22 @@ public function create(string $endUserType, string $phoneNumberType, array $opti } + /** + * Constructs a ComplianceRegistrationInquiriesContext + * + * @param string $registrationId The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. + */ + public function getContext( + string $registrationId + + ): ComplianceRegistrationInquiriesContext + { + return new ComplianceRegistrationInquiriesContext( + $this->version, + $registrationId + ); + } + /** * Provide a friendly representation * diff --git a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.php b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.php index c066f03d9..4c870b60d 100644 --- a/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.php +++ b/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.php @@ -57,6 +57,7 @@ abstract class ComplianceRegistrationInquiriesOptions * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. * @param string $isvRegisteringForSelfOrTenant Indicates if the isv registering for self or tenant. * @param string $statusCallbackUrl The url we call to inform you of bundle changes. + * @param string $themeSetId Theme id for styling the inquiry form. * @return CreateComplianceRegistrationInquiriesOptions Options builder */ public static function create( @@ -96,7 +97,8 @@ public static function create( string $individualPhone = Values::NONE, bool $isIsvEmbed = Values::BOOL_NONE, string $isvRegisteringForSelfOrTenant = Values::NONE, - string $statusCallbackUrl = Values::NONE + string $statusCallbackUrl = Values::NONE, + string $themeSetId = Values::NONE ): CreateComplianceRegistrationInquiriesOptions { @@ -136,7 +138,26 @@ public static function create( $individualPhone, $isIsvEmbed, $isvRegisteringForSelfOrTenant, - $statusCallbackUrl + $statusCallbackUrl, + $themeSetId + ); + } + + /** + * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. + * @param string $themeSetId Theme id for styling the inquiry form. + * @return UpdateComplianceRegistrationInquiriesOptions Options builder + */ + public static function update( + + bool $isIsvEmbed = Values::BOOL_NONE, + string $themeSetId = Values::NONE + + ): UpdateComplianceRegistrationInquiriesOptions + { + return new UpdateComplianceRegistrationInquiriesOptions( + $isIsvEmbed, + $themeSetId ); } @@ -181,6 +202,7 @@ class CreateComplianceRegistrationInquiriesOptions extends Options * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. * @param string $isvRegisteringForSelfOrTenant Indicates if the isv registering for self or tenant. * @param string $statusCallbackUrl The url we call to inform you of bundle changes. + * @param string $themeSetId Theme id for styling the inquiry form. */ public function __construct( @@ -219,7 +241,8 @@ public function __construct( string $individualPhone = Values::NONE, bool $isIsvEmbed = Values::BOOL_NONE, string $isvRegisteringForSelfOrTenant = Values::NONE, - string $statusCallbackUrl = Values::NONE + string $statusCallbackUrl = Values::NONE, + string $themeSetId = Values::NONE ) { $this->options['businessIdentityType'] = $businessIdentityType; @@ -258,6 +281,7 @@ public function __construct( $this->options['isIsvEmbed'] = $isIsvEmbed; $this->options['isvRegisteringForSelfOrTenant'] = $isvRegisteringForSelfOrTenant; $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['themeSetId'] = $themeSetId; } /** @@ -688,6 +712,18 @@ public function setStatusCallbackUrl(string $statusCallbackUrl): self return $this; } + /** + * Theme id for styling the inquiry form. + * + * @param string $themeSetId Theme id for styling the inquiry form. + * @return $this Fluent Builder + */ + public function setThemeSetId(string $themeSetId): self + { + $this->options['themeSetId'] = $themeSetId; + return $this; + } + /** * Provide a friendly representation * @@ -700,3 +736,55 @@ public function __toString(): string } } +class UpdateComplianceRegistrationInquiriesOptions extends Options + { + /** + * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. + * @param string $themeSetId Theme id for styling the inquiry form. + */ + public function __construct( + + bool $isIsvEmbed = Values::BOOL_NONE, + string $themeSetId = Values::NONE + + ) { + $this->options['isIsvEmbed'] = $isIsvEmbed; + $this->options['themeSetId'] = $themeSetId; + } + + /** + * Indicates if the inquiry is being started from an ISV embedded component. + * + * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. + * @return $this Fluent Builder + */ + public function setIsIsvEmbed(bool $isIsvEmbed): self + { + $this->options['isIsvEmbed'] = $isIsvEmbed; + return $this; + } + + /** + * Theme id for styling the inquiry form. + * + * @param string $themeSetId Theme id for styling the inquiry form. + * @return $this Fluent Builder + */ + public function setThemeSetId(string $themeSetId): self + { + $this->options['themeSetId'] = $themeSetId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateComplianceRegistrationInquiriesOptions ' . $options . ']'; + } +} + diff --git a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php index d459c1935..7e8ea00e7 100644 --- a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php +++ b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CustomerProfilesChannelEndpointAssignmentInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php index 3e78086a3..09246c86a 100644 --- a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php +++ b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): CustomerProfilesEntityAssignmentsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CustomerProfilesEntityAssignmentsInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php index 5c03d2106..4f754cf86 100644 --- a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php +++ b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php @@ -18,6 +18,7 @@ use Twilio\Exceptions\TwilioException; use Twilio\ListResource; +use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; @@ -78,6 +79,7 @@ public function create(string $objectSid): CustomerProfilesEntityAssignmentsInst * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * + * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit @@ -88,9 +90,9 @@ public function create(string $objectSid): CustomerProfilesEntityAssignmentsInst * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesEntityAssignmentsInstance[] Array of results */ - public function read(int $limit = null, $pageSize = null): array + public function read(array $options = [], int $limit = null, $pageSize = null): array { - return \iterator_to_array($this->stream($limit, $pageSize), false); + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** @@ -101,6 +103,7 @@ public function read(int $limit = null, $pageSize = null): array * The results are returned as a generator, so this operation is memory * efficient. * + * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit @@ -111,11 +114,11 @@ public function read(int $limit = null, $pageSize = null): array * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ - public function stream(int $limit = null, $pageSize = null): Stream + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); - $page = $this->page($limits['pageSize']); + $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } @@ -130,13 +133,17 @@ public function stream(int $limit = null, $pageSize = null): Stream * @return CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance */ public function page( + array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesEntityAssignmentsPage { + $options = new Values($options); $params = Values::of([ + 'ObjectType' => + $options['objectType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, diff --git a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsOptions.php b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsOptions.php new file mode 100644 index 000000000..ad1765f8b --- /dev/null +++ b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsOptions.php @@ -0,0 +1,82 @@ +options['objectType'] = $objectType; + } + + /** + * A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. + * + * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. + * @return $this Fluent Builder + */ + public function setObjectType(string $objectType): self + { + $this->options['objectType'] = $objectType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadCustomerProfilesEntityAssignmentsOptions ' . $options . ']'; + } +} + diff --git a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php index fd3e93468..37b6f58f3 100644 --- a/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php +++ b/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): CustomerProfilesEvaluationsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CustomerProfilesEvaluationsInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php b/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php index 6df1a7e98..6e8b38050 100644 --- a/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php +++ b/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): CustomerProfilesInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CustomerProfilesInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/EndUserContext.php b/src/Twilio/Rest/Trusthub/V1/EndUserContext.php index e549d14e1..9cb9dc21e 100644 --- a/src/Twilio/Rest/Trusthub/V1/EndUserContext.php +++ b/src/Twilio/Rest/Trusthub/V1/EndUserContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): EndUserInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EndUserInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php b/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php index 412210e35..bc7486728 100644 --- a/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php +++ b/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): EndUserTypeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EndUserTypeInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php b/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php index 808e3644c..6f647fdaf 100644 --- a/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php +++ b/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): PoliciesInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PoliciesInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php index bdf1b0475..14cacf888 100644 --- a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php +++ b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): SupportingDocumentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SupportingDocumentInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php index b58e3f6e3..b3dff5860 100644 --- a/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php +++ b/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): SupportingDocumentTypeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SupportingDocumentTypeInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php index 0f3477880..4ece84d04 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php +++ b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): TrustProductsChannelEndpointAssignmentInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrustProductsChannelEndpointAssignmentInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php index 5869b1c29..1e8d4e001 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php +++ b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): TrustProductsEntityAssignmentsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrustProductsEntityAssignmentsInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php index 9cd851c0a..122f3e29e 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php +++ b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php @@ -18,6 +18,7 @@ use Twilio\Exceptions\TwilioException; use Twilio\ListResource; +use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; @@ -78,6 +79,7 @@ public function create(string $objectSid): TrustProductsEntityAssignmentsInstanc * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * + * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit @@ -88,9 +90,9 @@ public function create(string $objectSid): TrustProductsEntityAssignmentsInstanc * efficient page size, i.e. min(limit, 1000) * @return TrustProductsEntityAssignmentsInstance[] Array of results */ - public function read(int $limit = null, $pageSize = null): array + public function read(array $options = [], int $limit = null, $pageSize = null): array { - return \iterator_to_array($this->stream($limit, $pageSize), false); + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** @@ -101,6 +103,7 @@ public function read(int $limit = null, $pageSize = null): array * The results are returned as a generator, so this operation is memory * efficient. * + * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit @@ -111,11 +114,11 @@ public function read(int $limit = null, $pageSize = null): array * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ - public function stream(int $limit = null, $pageSize = null): Stream + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); - $page = $this->page($limits['pageSize']); + $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } @@ -130,13 +133,17 @@ public function stream(int $limit = null, $pageSize = null): Stream * @return TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance */ public function page( + array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsEntityAssignmentsPage { + $options = new Values($options); $params = Values::of([ + 'ObjectType' => + $options['objectType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsOptions.php b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsOptions.php new file mode 100644 index 000000000..5b164801d --- /dev/null +++ b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsOptions.php @@ -0,0 +1,82 @@ +options['objectType'] = $objectType; + } + + /** + * A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. + * + * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. + * @return $this Fluent Builder + */ + public function setObjectType(string $objectType): self + { + $this->options['objectType'] = $objectType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadTrustProductsEntityAssignmentsOptions ' . $options . ']'; + } +} + diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php index c8c1bf7f7..614c7a972 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php +++ b/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): TrustProductsEvaluationsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrustProductsEvaluationsInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php b/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php index 1942abaca..a60d71560 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php +++ b/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php @@ -46,7 +46,7 @@ class TrustProductsContext extends InstanceContext * Initialize the TrustProductsContext * * @param Version $version Version that contains the resource - * @param string $sid The unique string that we created to identify the Customer-Profile resource. + * @param string $sid The unique string that we created to identify the Trust Product resource. */ public function __construct( Version $version, @@ -86,7 +86,7 @@ public function delete(): bool public function fetch(): TrustProductsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrustProductsInstance( $this->version, diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php b/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php index 5ead29823..6ea2e912e 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php +++ b/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php @@ -53,7 +53,7 @@ class TrustProductsInstance extends InstanceResource * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload - * @param string $sid The unique string that we created to identify the Customer-Profile resource. + * @param string $sid The unique string that we created to identify the Trust Product resource. */ public function __construct(Version $version, array $payload, string $sid = null) { diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php b/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php index e4a19df24..9a55c738a 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php +++ b/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php @@ -47,8 +47,8 @@ public function __construct( * 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 string $email The email address that will receive updates when the Trust Product resource changes status. + * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. * @param array|Options $options Optional Arguments * @return TrustProductsInstance Created TrustProductsInstance * @throws TwilioException When an HTTP error occurs. @@ -183,7 +183,7 @@ public function getPage(string $targetUrl): TrustProductsPage /** * Constructs a TrustProductsContext * - * @param string $sid The unique string that we created to identify the Customer-Profile resource. + * @param string $sid The unique string that we created to identify the Trust Product resource. */ public function getContext( string $sid diff --git a/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php b/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php index 3d96e413c..733126018 100644 --- a/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php +++ b/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php @@ -38,9 +38,9 @@ public static function create( /** - * @param string $status The verification status of the Customer-Profile resource. + * @param string $status The verification status of the Trust Product resource. * @param string $friendlyName The string that you assigned to describe the resource. - * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. * @return ReadTrustProductsOptions Options builder */ public static function read( @@ -62,7 +62,7 @@ public static function read( * @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. + * @param string $email The email address that will receive updates when the Trust Product resource changes status. * @return UpdateTrustProductsOptions Options builder */ public static function update( @@ -126,9 +126,9 @@ public function __toString(): string class ReadTrustProductsOptions extends Options { /** - * @param string $status The verification status of the Customer-Profile resource. + * @param string $status The verification status of the Trust Product resource. * @param string $friendlyName The string that you assigned to describe the resource. - * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. */ public function __construct( @@ -143,9 +143,9 @@ public function __construct( } /** - * The verification status of the Customer-Profile resource. + * The verification status of the Trust Product resource. * - * @param string $status The verification status of the Customer-Profile resource. + * @param string $status The verification status of the Trust Product resource. * @return $this Fluent Builder */ public function setStatus(string $status): self @@ -167,9 +167,9 @@ public function setFriendlyName(string $friendlyName): self } /** - * The unique string of a policy that is associated to the Customer-Profile resource. + * The unique string of a policy that is associated to the Trust Product resource. * - * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. * @return $this Fluent Builder */ public function setPolicySid(string $policySid): self @@ -196,7 +196,7 @@ 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. + * @param string $email The email address that will receive updates when the Trust Product resource changes status. */ public function __construct( @@ -247,9 +247,9 @@ public function setFriendlyName(string $friendlyName): self } /** - * The email address that will receive updates when the Customer-Profile resource changes status. + * The email address that will receive updates when the Trust Product resource changes status. * - * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + * @param string $email The email address that will receive updates when the Trust Product resource changes status. * @return $this Fluent Builder */ public function setEmail(string $email): self diff --git a/src/Twilio/Rest/Verify/V2/FormContext.php b/src/Twilio/Rest/Verify/V2/FormContext.php index e4255059c..221b6d265 100644 --- a/src/Twilio/Rest/Verify/V2/FormContext.php +++ b/src/Twilio/Rest/Verify/V2/FormContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): FormInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FormInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/SafelistContext.php b/src/Twilio/Rest/Verify/V2/SafelistContext.php index ce09b314b..2f47cdc7e 100644 --- a/src/Twilio/Rest/Verify/V2/SafelistContext.php +++ b/src/Twilio/Rest/Verify/V2/SafelistContext.php @@ -68,7 +68,7 @@ public function delete(): bool public function fetch(): SafelistInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SafelistInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php b/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php index 50e1e758e..47d70195b 100644 --- a/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php @@ -60,7 +60,7 @@ public function __construct( public function fetch(): AccessTokenInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new AccessTokenInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php b/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php index 1693dbc06..1f4581616 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php @@ -75,7 +75,7 @@ public function __construct( public function fetch(): ChallengeInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChallengeInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php b/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php index 06032b280..68084753d 100644 --- a/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): FactorInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new FactorInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/EntityContext.php b/src/Twilio/Rest/Verify/V2/Service/EntityContext.php index be07b9c12..2a9684602 100644 --- a/src/Twilio/Rest/Verify/V2/Service/EntityContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/EntityContext.php @@ -88,7 +88,7 @@ public function delete(): bool public function fetch(): EntityInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new EntityInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php b/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php index 3147ecbb0..823e74d43 100644 --- a/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php @@ -74,7 +74,7 @@ public function delete(): bool public function fetch(): MessagingConfigurationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessagingConfigurationInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php b/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php index 7a81296f1..19c3d717f 100644 --- a/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): BucketInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new BucketInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php b/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php index de5abc5ee..3a20a6711 100644 --- a/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php @@ -83,7 +83,7 @@ public function delete(): bool public function fetch(): RateLimitInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RateLimitInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php b/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php index 0c89fff76..217193766 100644 --- a/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php @@ -61,7 +61,7 @@ public function __construct( public function fetch(): VerificationInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new VerificationInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php b/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php index 7517fcf06..b1e312eea 100644 --- a/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php +++ b/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): WebhookInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/ServiceContext.php b/src/Twilio/Rest/Verify/V2/ServiceContext.php index 90e5d07fc..5dd65454f 100644 --- a/src/Twilio/Rest/Verify/V2/ServiceContext.php +++ b/src/Twilio/Rest/Verify/V2/ServiceContext.php @@ -102,7 +102,7 @@ public function delete(): bool public function fetch(): ServiceInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php b/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php index 8ff7956ad..9bb350173 100644 --- a/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php +++ b/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php @@ -55,7 +55,7 @@ public function __construct( public function fetch(): VerificationAttemptInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new VerificationAttemptInstance( $this->version, diff --git a/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php b/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php index c3bfc3032..0cccb2503 100644 --- a/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php +++ b/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php @@ -71,7 +71,7 @@ public function fetch(array $options = []): VerificationAttemptsSummaryInstance $options['destinationPrefix'], ]); - $payload = $this->version->fetch('GET', $this->uri, $params); + $payload = $this->version->fetch('GET', $this->uri, $params, []); return new VerificationAttemptsSummaryInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/CompositionContext.php b/src/Twilio/Rest/Video/V1/CompositionContext.php index 77c6bc5df..4fb7bed2b 100644 --- a/src/Twilio/Rest/Video/V1/CompositionContext.php +++ b/src/Twilio/Rest/Video/V1/CompositionContext.php @@ -68,7 +68,7 @@ public function delete(): bool public function fetch(): CompositionInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CompositionInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/CompositionHookContext.php b/src/Twilio/Rest/Video/V1/CompositionHookContext.php index a901177fe..6f2ce84c1 100644 --- a/src/Twilio/Rest/Video/V1/CompositionHookContext.php +++ b/src/Twilio/Rest/Video/V1/CompositionHookContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): CompositionHookInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CompositionHookInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php b/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php index d7a51dbbc..8d1452abf 100644 --- a/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php +++ b/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php @@ -90,7 +90,7 @@ public function create(string $friendlyName, array $options = []): CompositionSe public function fetch(): CompositionSettingsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CompositionSettingsInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/RecordingContext.php b/src/Twilio/Rest/Video/V1/RecordingContext.php index f1f22a474..5294273df 100644 --- a/src/Twilio/Rest/Video/V1/RecordingContext.php +++ b/src/Twilio/Rest/Video/V1/RecordingContext.php @@ -68,7 +68,7 @@ public function delete(): bool public function fetch(): RecordingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php b/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php index 0099cb195..b3d05cae3 100644 --- a/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php +++ b/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php @@ -90,7 +90,7 @@ public function create(string $friendlyName, array $options = []): RecordingSett public function fetch(): RecordingSettingsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingSettingsInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php b/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php index 127a8673f..3e855d5c0 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php +++ b/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php @@ -60,7 +60,7 @@ public function __construct( public function update(): AnonymizeInstance { - $payload = $this->version->update('POST', $this->uri); + $payload = $this->version->update('POST', $this->uri, [], []); return new AnonymizeInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php b/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php index c94b252e8..e0d71347b 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php +++ b/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): PublishedTrackInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new PublishedTrackInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php b/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php index 1a87c7211..88120afb2 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php +++ b/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php @@ -64,7 +64,7 @@ public function __construct( public function fetch(): SubscribeRulesInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SubscribeRulesInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php b/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php index dc10fbdb9..2744b1d6d 100644 --- a/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php +++ b/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php @@ -65,7 +65,7 @@ public function __construct( public function fetch(): SubscribedTrackInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SubscribedTrackInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php b/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php index 1024d6b58..1c5b43eba 100644 --- a/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php +++ b/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php @@ -81,7 +81,7 @@ public function __construct( public function fetch(): ParticipantInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php b/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php index ae77602d7..e0b85f027 100644 --- a/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php +++ b/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php @@ -58,7 +58,7 @@ public function __construct( public function fetch(): RecordingRulesInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingRulesInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php b/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php index cc4bdf84e..87138023c 100644 --- a/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php +++ b/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php @@ -73,7 +73,7 @@ public function delete(): bool public function fetch(): RoomRecordingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoomRecordingInstance( $this->version, diff --git a/src/Twilio/Rest/Video/V1/RoomContext.php b/src/Twilio/Rest/Video/V1/RoomContext.php index c52b7be82..2bca7b58f 100644 --- a/src/Twilio/Rest/Video/V1/RoomContext.php +++ b/src/Twilio/Rest/Video/V1/RoomContext.php @@ -71,7 +71,7 @@ public function __construct( public function fetch(): RoomInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoomInstance( $this->version, diff --git a/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php b/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php index 083a0a8da..883eda6cf 100644 --- a/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php +++ b/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php @@ -71,7 +71,7 @@ public function delete(): bool public function fetch(): ByocTrunkInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ByocTrunkInstance( $this->version, diff --git a/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php b/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php index 94f1b88fe..568e86b8d 100644 --- a/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php +++ b/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php @@ -76,7 +76,7 @@ public function delete(): bool public function fetch(): ConnectionPolicyTargetInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConnectionPolicyTargetInstance( $this->version, diff --git a/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php b/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php index 43a8dfe0c..ea41f0d77 100644 --- a/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php +++ b/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php @@ -78,7 +78,7 @@ public function delete(): bool public function fetch(): ConnectionPolicyInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConnectionPolicyInstance( $this->version, diff --git a/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php b/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php index a472a5e96..b904e21f5 100644 --- a/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php +++ b/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php @@ -62,7 +62,7 @@ public function __construct( public function fetch(): CountryInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, diff --git a/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php b/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php index e3b2594dd..3d4188ebb 100644 --- a/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php +++ b/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php @@ -53,7 +53,7 @@ public function __construct( public function fetch(): SettingsInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SettingsInstance( $this->version, diff --git a/src/Twilio/Rest/Voice/V1/IpRecordContext.php b/src/Twilio/Rest/Voice/V1/IpRecordContext.php index 97b4650bd..503eca182 100644 --- a/src/Twilio/Rest/Voice/V1/IpRecordContext.php +++ b/src/Twilio/Rest/Voice/V1/IpRecordContext.php @@ -70,7 +70,7 @@ public function delete(): bool public function fetch(): IpRecordInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpRecordInstance( $this->version, diff --git a/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php b/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php index 627d3384a..208a57c00 100644 --- a/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php +++ b/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php @@ -69,7 +69,7 @@ public function delete(): bool public function fetch(): SourceIpMappingInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SourceIpMappingInstance( $this->version, diff --git a/src/Twilio/Rest/Wireless/V1/CommandContext.php b/src/Twilio/Rest/Wireless/V1/CommandContext.php index a22d46a23..a8c5cc862 100644 --- a/src/Twilio/Rest/Wireless/V1/CommandContext.php +++ b/src/Twilio/Rest/Wireless/V1/CommandContext.php @@ -68,7 +68,7 @@ public function delete(): bool public function fetch(): CommandInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new CommandInstance( $this->version, diff --git a/src/Twilio/Rest/Wireless/V1/RatePlanContext.php b/src/Twilio/Rest/Wireless/V1/RatePlanContext.php index dbc4983c9..fe3f95d45 100644 --- a/src/Twilio/Rest/Wireless/V1/RatePlanContext.php +++ b/src/Twilio/Rest/Wireless/V1/RatePlanContext.php @@ -70,7 +70,7 @@ public function delete(): bool public function fetch(): RatePlanInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new RatePlanInstance( $this->version, diff --git a/src/Twilio/Rest/Wireless/V1/SimContext.php b/src/Twilio/Rest/Wireless/V1/SimContext.php index bf0723b22..6337a496c 100644 --- a/src/Twilio/Rest/Wireless/V1/SimContext.php +++ b/src/Twilio/Rest/Wireless/V1/SimContext.php @@ -80,7 +80,7 @@ public function delete(): bool public function fetch(): SimInstance { - $payload = $this->version->fetch('GET', $this->uri); + $payload = $this->version->fetch('GET', $this->uri, [], []); return new SimInstance( $this->version, From 5d011d87af2d0f52ccade0525e782af2ab19d681 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 1 Apr 2024 10:13:41 +0000 Subject: [PATCH 3/4] Release 8.0.0-rc.1 --- src/Twilio/VersionInfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Twilio/VersionInfo.php b/src/Twilio/VersionInfo.php index d39ab56b1..f12ba666a 100644 --- a/src/Twilio/VersionInfo.php +++ b/src/Twilio/VersionInfo.php @@ -7,7 +7,7 @@ class VersionInfo { const MAJOR = "8"; const MINOR = "0"; - const PATCH = "0-rc.0"; + const PATCH = "0-rc.1"; public static function string() { return implode('.', array(self::MAJOR, self::MINOR, self::PATCH)); From 2710042d0952221210daeee0ab86a04704565201 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 4 Apr 2024 17:24:25 +0530 Subject: [PATCH 4/4] feat!: MVR preparation (#802) * docs: added messaging bulk example * docs: corrected text message * feat!: MVR preparation --- CHANGES.md | 45 ------------------------------- UPGRADE.md | 8 +++--- example/messaging_bulk.php | 54 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 48 deletions(-) create mode 100644 example/messaging_bulk.php diff --git a/CHANGES.md b/CHANGES.md index 43011eb97..fcf865d17 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,51 +1,6 @@ twilio-php Changelog ==================== -[2024-04-01] Version 8.0.0-rc.1 -------------------------------- -**Library - Chore** -- [PR #799](https://github.com/twilio/twilio-php/pull/799): provide application/json support in request body. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! - -**Api** -- Add property `queue_time` to conference participant resource -- Update RiskCheck documentation -- Correct call filtering by start and end time documentation, clarifying that times are UTC. - -**Flex** -- Adding optional parameter to `plugins` - -**Media** -- Remove API: MediaProcessor - -**Messaging** -- Remove Sending-Window due to test failure -- Add Sending-Window as a response property to Messaging Services, gated by a beta feature flag - -**Numbers** -- Correct valid_until_date field to be visible in Bundles resource -- Adding port_in_status field to the Port In resource and phone_number_status and sid fields to the Port In Phone Number resource - -**Oauth** -- Modified token endpoint response -- Added refresh_token and scope as optional parameter to token endpoint -- Add new APIs for vendor authorize and token endpoints - -**Trusthub** -- Add update inquiry endpoint in compliance_registration. -- Add new field in themeSetId in compliance_registration. - -**Voice** -- Correct call filtering by start and end time documentation, clarifying that times are UTC. - -**Twiml** -- Add support for new Google voices (Q1 2024) for `Say` verb - gu-IN voices -- Add support for new Amazon Polly and Google voices (Q1 2024) for `Say` verb - Niamh (en-IE) and Sofie (da-DK) voices - - -[2024-03-25] Version 8.0.0-rc.0 ---------------------------- -- Release Candidate Preparation - [2024-03-12] Version 7.16.1 --------------------------- **Api** diff --git a/UPGRADE.md b/UPGRADE.md index 10db9ef26..171d2dc14 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -2,10 +2,12 @@ _MAJOR version bumps will have upgrade notes posted here._ -[2023-03-25] 7.x.x to 8.x.x-rc.x +[2023-03-25] 7.x.x to 8.x.x --------------------------- -Twilio Php Helper Library’s major version 8.0.0-rc.x is now available. We ensured that you can upgrade to Php helper Library 8.0.0-rc.x version without any breaking changes -Twilio Helper libraries now support nested json body while sending requests. +Twilio Php Helper Library’s major version 8.0.0 is now available. We ensured that you can upgrade to Php helper Library 8.0.0 version without any breaking changes of existing apis + +Behind the scenes Php Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages. +We're pleased to inform you that version 8.0.0 adds support for the application/json content type in the request body. [2023-03-08] 6.x.x to 7.x.x --------------------------- diff --git a/example/messaging_bulk.php b/example/messaging_bulk.php new file mode 100644 index 000000000..3456ad960 --- /dev/null +++ b/example/messaging_bulk.php @@ -0,0 +1,54 @@ + $phoneNumber1, + ] +); +$message2 = MessageModels::createMessagingV1Message( + [ + 'to' => $phoneNumber2, + ] +); + +// Create list of the message objects +$messages = [$message1, $message2]; + +// This must be a Twilio phone number that you own, formatted with a '+' and country code +$twilioPurchasedNumber = "+XXXXXXXXXX"; +// Specify the message to be sent - JSON string supported +$messageBody = "Hello from twilio-php!"; + +// Create Message Request object +$createMessagesRequest = MessageModels::createCreateMessagesRequest( + [ + 'messages' => $messages, + 'from' => $twilioPurchasedNumber, + 'body' => $messageBody, + ] +); + +// Send a Bulk Message +$message = $client->previewMessaging->v1->messages->create($createMessagesRequest); + +// Print how many messages were successful +print($message->successCount . " messages sent successfully!" . "\n\n"); + +// Print the message details +foreach ($message->messageReceipts as $msg) { + print("ID:: " . $msg["sid"] . " | " . "TO:: " . $msg["to"] . "\n"); +}