summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatt <matt@twilio.com>2016-07-14 13:28:36 -0700
committermatt <matt@twilio.com>2016-07-14 13:28:36 -0700
commitb22d3f3d340fdab86af97c21ef164239e0ec0048 (patch)
tree6c1c85ab59541520c0a4ff33ab3b4ce1ce788866
parenta842aafe7364130cf4dea37df40b2c674491adbb (diff)
parent59fed9b516345ed3d6548424235012d6a347e656 (diff)
downloadtwilio-php-origin/next-gen-autoloader.zip
twilio-php-origin/next-gen-autoloader.tar.gz
twilio-php-origin/next-gen-autoloader.tar.bz2
Merge branch 'next-gen-public' into next-gen-autoloaderorigin/next-gen-autoloader
-rw-r--r--Twilio/Page.php11
-rw-r--r--Twilio/Rest/Api.php38
-rw-r--r--Twilio/Rest/Api/V2010.php38
-rw-r--r--Twilio/Rest/Api/V2010/Account/CallList.php2
-rw-r--r--Twilio/Rest/Api/V2010/Account/KeyContext.php108
-rw-r--r--Twilio/Rest/Api/V2010/Account/KeyInstance.php132
-rw-r--r--Twilio/Rest/Api/V2010/Account/KeyList.php (renamed from Twilio/Rest/Conversations/V1/Conversation/CompletedList.php)46
-rw-r--r--Twilio/Rest/Api/V2010/Account/KeyPage.php (renamed from Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php)10
-rw-r--r--Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php82
-rw-r--r--Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php73
-rw-r--r--Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php39
-rw-r--r--Twilio/Rest/Api/V2010/Account/MessageContext.php20
-rw-r--r--Twilio/Rest/Api/V2010/Account/MessageInstance.php10
-rw-r--r--Twilio/Rest/Api/V2010/Account/MessageList.php8
-rw-r--r--Twilio/Rest/Api/V2010/Account/NewKeyInstance.php (renamed from Twilio/Rest/Conversations/V1/Conversation/CompletedInstance.php)36
-rw-r--r--Twilio/Rest/Api/V2010/Account/NewKeyList.php71
-rw-r--r--Twilio/Rest/Api/V2010/Account/NewKeyPage.php38
-rw-r--r--Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php (renamed from Twilio/Rest/Conversations/V1/Conversation/InProgressInstance.php)36
-rw-r--r--Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php71
-rw-r--r--Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php38
-rw-r--r--Twilio/Rest/Api/V2010/Account/SigningKeyContext.php108
-rw-r--r--Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php132
-rw-r--r--Twilio/Rest/Api/V2010/Account/SigningKeyList.php134
-rw-r--r--Twilio/Rest/Api/V2010/Account/SigningKeyPage.php38
-rw-r--r--Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php2
-rw-r--r--Twilio/Rest/Api/V2010/Account/Sip/DomainList.php1
-rw-r--r--Twilio/Rest/Api/V2010/AccountContext.php78
-rw-r--r--Twilio/Rest/Api/V2010/AccountInstance.php40
-rw-r--r--Twilio/Rest/Client.php69
-rw-r--r--Twilio/Rest/Conversations/V1/ConversationList.php119
-rw-r--r--Twilio/Rest/Lookups/V1/PhoneNumberContext.php3
-rw-r--r--Twilio/Rest/Lookups/V1/PhoneNumberInstance.php3
-rw-r--r--Twilio/Rest/Notifications.php7
-rw-r--r--Twilio/Rest/Notifications/V1.php14
-rw-r--r--Twilio/Rest/Notifications/V1/CredentialContext.php111
-rw-r--r--Twilio/Rest/Notifications/V1/CredentialInstance.php140
-rw-r--r--Twilio/Rest/Notifications/V1/CredentialList.php (renamed from Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php)64
-rw-r--r--Twilio/Rest/Notifications/V1/CredentialPage.php (renamed from Twilio/Rest/Conversations/V1/ConversationPage.php)8
-rw-r--r--Twilio/Rest/Notifications/V1/Service/NotificationInstance.php4
-rw-r--r--Twilio/Rest/Notifications/V1/Service/NotificationList.php2
-rw-r--r--Twilio/Rest/Notifications/V1/ServiceContext.php2
-rw-r--r--Twilio/Rest/Notifications/V1/ServiceInstance.php4
-rw-r--r--Twilio/Rest/Notifications/V1/ServiceList.php2
-rw-r--r--Twilio/Rest/Preview.php (renamed from Twilio/Rest/Conversations.php)46
-rw-r--r--Twilio/Rest/Preview/Wireless.php (renamed from Twilio/Rest/Conversations/V1.php)58
-rw-r--r--Twilio/Rest/Preview/Wireless/CommandContext.php (renamed from Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php)23
-rw-r--r--Twilio/Rest/Preview/Wireless/CommandInstance.php (renamed from Twilio/Rest/Conversations/V1/ConversationInstance.php)49
-rw-r--r--Twilio/Rest/Preview/Wireless/CommandList.php171
-rw-r--r--Twilio/Rest/Preview/Wireless/CommandPage.php (renamed from Twilio/Rest/Conversations/V1/Conversation/CompletedPage.php)8
-rw-r--r--Twilio/Rest/Preview/Wireless/Device/UsageContext.php74
-rw-r--r--Twilio/Rest/Preview/Wireless/Device/UsageInstance.php119
-rw-r--r--Twilio/Rest/Preview/Wireless/Device/UsageList.php52
-rw-r--r--Twilio/Rest/Preview/Wireless/Device/UsagePage.php38
-rw-r--r--Twilio/Rest/Preview/Wireless/DeviceContext.php (renamed from Twilio/Rest/Conversations/V1/ConversationContext.php)72
-rw-r--r--Twilio/Rest/Preview/Wireless/DeviceInstance.php148
-rw-r--r--Twilio/Rest/Preview/Wireless/DeviceList.php175
-rw-r--r--Twilio/Rest/Preview/Wireless/DevicePage.php (renamed from Twilio/Rest/Conversations/V1/Conversation/InProgressPage.php)8
-rw-r--r--Twilio/Rest/Preview/Wireless/RatePlanContext.php68
-rw-r--r--Twilio/Rest/Preview/Wireless/RatePlanInstance.php (renamed from Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php)62
-rw-r--r--Twilio/Rest/Preview/Wireless/RatePlanList.php (renamed from Twilio/Rest/Conversations/V1/Conversation/InProgressList.php)37
-rw-r--r--Twilio/Rest/Preview/Wireless/RatePlanPage.php37
-rw-r--r--Twilio/Serialize.php26
-rw-r--r--Twilio/Tests/Integration/Api/V2010/Account/KeyTest.php183
-rw-r--r--Twilio/Tests/Integration/Api/V2010/Account/Message/FeedbackTest.php34
-rw-r--r--Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php5
-rw-r--r--Twilio/Tests/Integration/Api/V2010/Account/NewKeyTest.php53
-rw-r--r--Twilio/Tests/Integration/Api/V2010/Account/NewSigningKeyTest.php53
-rw-r--r--Twilio/Tests/Integration/Api/V2010/Account/SigningKeyTest.php183
-rw-r--r--Twilio/Tests/Integration/Conversations/V1/Conversation/CompletedTest.php97
-rw-r--r--Twilio/Tests/Integration/Conversations/V1/Conversation/InProgressTest.php97
-rw-r--r--Twilio/Tests/Integration/Conversations/V1/Conversation/ParticipantTest.php183
-rw-r--r--Twilio/Tests/Integration/Conversations/V1/ConversationTest.php57
-rw-r--r--Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php6
-rw-r--r--Twilio/Tests/Integration/Notifications/V1/CredentialTest.php238
-rw-r--r--Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php2
-rw-r--r--Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php4
-rw-r--r--Twilio/Tests/Integration/Notifications/V1/ServiceTest.php8
-rw-r--r--Twilio/Tests/Integration/Preview/Wireless/CommandTest.php67
-rw-r--r--Twilio/Tests/Integration/Preview/Wireless/Device/UsageTest.php33
-rw-r--r--Twilio/Tests/Integration/Preview/Wireless/DeviceTest.php80
-rw-r--r--Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php46
-rw-r--r--Twilio/Tests/Unit/SerializeTest.php54
-rw-r--r--Twilio/Version.php8
-rw-r--r--Twilio/VersionInfo.php2
84 files changed, 3942 insertions, 814 deletions
diff --git a/Twilio/Page.php b/Twilio/Page.php
index 55958b5..67e89e2 100644
--- a/Twilio/Page.php
+++ b/Twilio/Page.php
@@ -39,12 +39,16 @@ abstract class Page implements \Iterator {
}
protected function processResponse(Response $response) {
- if ($response->getStatusCode() != 200) {
+ if ($response->getStatusCode() != 200 && !$this->isPagingEol($response->getContent())) {
throw new DeserializeException('Unable to fetch page', $response->getStatusCode());
}
return $response->getContent();
}
+ protected function isPagingEol($content) {
+ return !is_null($content) && array_key_exists('code', $content) && $content['code'] == 20006;
+ }
+
protected function hasMeta($key) {
return array_key_exists('meta', $this->payload) && array_key_exists($key, $this->payload['meta']);
}
@@ -67,6 +71,11 @@ abstract class Page implements \Iterator {
}
}
+ // handle end of results error code
+ if ($this->isPagingEol($this->payload)) {
+ return array();
+ }
+
throw new DeserializeException('Page Records can not be deserialized');
}
diff --git a/Twilio/Rest/Api.php b/Twilio/Rest/Api.php
index 5c01989..f85bb21 100644
--- a/Twilio/Rest/Api.php
+++ b/Twilio/Rest/Api.php
@@ -24,12 +24,16 @@ use Twilio\Rest\Api\V2010;
* @property \Twilio\Rest\Api\V2010\Account\ConferenceList conferences
* @property \Twilio\Rest\Api\V2010\Account\ConnectAppList connectApps
* @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList incomingPhoneNumbers
+ * @property \Twilio\Rest\Api\V2010\Account\KeyList keys
* @property \Twilio\Rest\Api\V2010\Account\MessageList messages
+ * @property \Twilio\Rest\Api\V2010\Account\NewKeyList newKeys
+ * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList newSigningKeys
* @property \Twilio\Rest\Api\V2010\Account\NotificationList notifications
* @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList outgoingCallerIds
* @property \Twilio\Rest\Api\V2010\Account\QueueList queues
* @property \Twilio\Rest\Api\V2010\Account\RecordingList recordings
* @property \Twilio\Rest\Api\V2010\Account\SandboxList sandbox
+ * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList signingKeys
* @property \Twilio\Rest\Api\V2010\Account\SipList sip
* @property \Twilio\Rest\Api\V2010\Account\SmsList sms
* @property \Twilio\Rest\Api\V2010\Account\TokenList tokens
@@ -44,12 +48,14 @@ use Twilio\Rest\Api\V2010;
* @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid)
+ * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\SandboxContext sandbox()
+ * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid)
*/
class Api extends Domain {
@@ -63,12 +69,16 @@ class Api extends Domain {
protected $_conferences = null;
protected $_connectApps = null;
protected $_incomingPhoneNumbers = null;
+ protected $_keys = null;
protected $_messages = null;
+ protected $_newKeys = null;
+ protected $_newSigningKeys = null;
protected $_notifications = null;
protected $_outgoingCallerIds = null;
protected $_queues = null;
protected $_recordings = null;
protected $_sandbox = null;
+ protected $_signingKeys = null;
protected $_sip = null;
protected $_sms = null;
protected $_tokens = null;
@@ -204,6 +214,13 @@ class Api extends Domain {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\KeyList
+ */
+ public function getKeys() {
+ return $this->v2010->account->keys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\MessageList
*/
public function getMessages() {
@@ -211,6 +228,20 @@ class Api extends Domain {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\NewKeyList
+ */
+ public function getNewKeys() {
+ return $this->v2010->account->newKeys;
+ }
+
+ /**
+ * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList
+ */
+ public function getNewSigningKeys() {
+ return $this->v2010->account->newSigningKeys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\NotificationList
*/
public function getNotifications() {
@@ -246,6 +277,13 @@ class Api extends Domain {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList
+ */
+ public function getSigningKeys() {
+ return $this->v2010->account->signingKeys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\SipList
*/
public function getSip() {
diff --git a/Twilio/Rest/Api/V2010.php b/Twilio/Rest/Api/V2010.php
index cc0894d..585a9ec 100644
--- a/Twilio/Rest/Api/V2010.php
+++ b/Twilio/Rest/Api/V2010.php
@@ -28,12 +28,16 @@ use Twilio\Version;
* @property \Twilio\Rest\Api\V2010\Account\ConferenceList conferences
* @property \Twilio\Rest\Api\V2010\Account\ConnectAppList connectApps
* @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList incomingPhoneNumbers
+ * @property \Twilio\Rest\Api\V2010\Account\KeyList keys
* @property \Twilio\Rest\Api\V2010\Account\MessageList messages
+ * @property \Twilio\Rest\Api\V2010\Account\NewKeyList newKeys
+ * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList newSigningKeys
* @property \Twilio\Rest\Api\V2010\Account\NotificationList notifications
* @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList outgoingCallerIds
* @property \Twilio\Rest\Api\V2010\Account\QueueList queues
* @property \Twilio\Rest\Api\V2010\Account\RecordingList recordings
* @property \Twilio\Rest\Api\V2010\Account\SandboxList sandbox
+ * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList signingKeys
* @property \Twilio\Rest\Api\V2010\Account\SipList sip
* @property \Twilio\Rest\Api\V2010\Account\SmsList sms
* @property \Twilio\Rest\Api\V2010\Account\TokenList tokens
@@ -48,12 +52,14 @@ use Twilio\Version;
* @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid)
+ * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\SandboxContext sandbox()
+ * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid)
*/
class V2010 extends Version {
@@ -67,12 +73,16 @@ class V2010 extends Version {
protected $_conferences = null;
protected $_connectApps = null;
protected $_incomingPhoneNumbers = null;
+ protected $_keys = null;
protected $_messages = null;
+ protected $_newKeys = null;
+ protected $_newSigningKeys = null;
protected $_notifications = null;
protected $_outgoingCallerIds = null;
protected $_queues = null;
protected $_recordings = null;
protected $_sandbox = null;
+ protected $_signingKeys = null;
protected $_sip = null;
protected $_sms = null;
protected $_tokens = null;
@@ -182,6 +192,13 @@ class V2010 extends Version {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\KeyList
+ */
+ protected function getKeys() {
+ return $this->account->keys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\MessageList
*/
protected function getMessages() {
@@ -189,6 +206,20 @@ class V2010 extends Version {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\NewKeyList
+ */
+ protected function getNewKeys() {
+ return $this->account->newKeys;
+ }
+
+ /**
+ * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList
+ */
+ protected function getNewSigningKeys() {
+ return $this->account->newSigningKeys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\NotificationList
*/
protected function getNotifications() {
@@ -224,6 +255,13 @@ class V2010 extends Version {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList
+ */
+ protected function getSigningKeys() {
+ return $this->account->signingKeys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\SipList
*/
protected function getSip() {
diff --git a/Twilio/Rest/Api/V2010/Account/CallList.php b/Twilio/Rest/Api/V2010/Account/CallList.php
index f014e16..daf430f 100644
--- a/Twilio/Rest/Api/V2010/Account/CallList.php
+++ b/Twilio/Rest/Api/V2010/Account/CallList.php
@@ -66,6 +66,8 @@ class CallList extends ListResource {
'IfMachine' => $options['ifMachine'],
'Timeout' => $options['timeout'],
'Record' => $options['record'],
+ 'SipAuthUsername' => $options['sipAuthUsername'],
+ 'SipAuthPassword' => $options['sipAuthPassword'],
));
$payload = $this->version->create(
diff --git a/Twilio/Rest/Api/V2010/Account/KeyContext.php b/Twilio/Rest/Api/V2010/Account/KeyContext.php
new file mode 100644
index 0000000..25c5258
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/KeyContext.php
@@ -0,0 +1,108 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\InstanceContext;
+use Twilio\Values;
+use Twilio\Version;
+
+class KeyContext extends InstanceContext {
+ /**
+ * Initialize the KeyContext
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param string $accountSid The account_sid
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Api\V2010\Account\KeyContext
+ */
+ public function __construct(Version $version, $accountSid, $sid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ 'sid' => $sid,
+ );
+
+ $this->uri = '/Accounts/' . $accountSid . '/Keys/' . $sid . '.json';
+ }
+
+ /**
+ * Fetch a KeyInstance
+ *
+ * @return KeyInstance Fetched KeyInstance
+ */
+ public function fetch() {
+ $params = Values::of(array());
+
+ $payload = $this->version->fetch(
+ 'GET',
+ $this->uri,
+ $params
+ );
+
+ return new KeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid'],
+ $this->solution['sid']
+ );
+ }
+
+ /**
+ * Update the KeyInstance
+ *
+ * @param array $options Optional Arguments
+ * @return KeyInstance Updated KeyInstance
+ */
+ public function update(array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'FriendlyName' => $options['friendlyName'],
+ ));
+
+ $payload = $this->version->update(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new KeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid'],
+ $this->solution['sid']
+ );
+ }
+
+ /**
+ * Deletes the KeyInstance
+ *
+ * @return boolean True if delete succeeds, false otherwise
+ */
+ public function delete() {
+ return $this->version->delete('delete', $this->uri);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Api.V2010.KeyContext ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/KeyInstance.php b/Twilio/Rest/Api/V2010/Account/KeyInstance.php
new file mode 100644
index 0000000..aef279a
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/KeyInstance.php
@@ -0,0 +1,132 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\Deserialize;
+use Twilio\Exceptions\TwilioException;
+use Twilio\InstanceResource;
+use Twilio\Version;
+
+/**
+ * @property string sid
+ * @property string friendlyName
+ * @property \DateTime dateCreated
+ * @property \DateTime dateUpdated
+ */
+class KeyInstance extends InstanceResource {
+ /**
+ * Initialize the KeyInstance
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param mixed[] $payload The response payload
+ * @param string $accountSid A 34 character string that uniquely identifies
+ * this resource.
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Api\V2010\Account\KeyInstance
+ */
+ public function __construct(Version $version, array $payload, $accountSid, $sid = null) {
+ parent::__construct($version);
+
+ // Marshaled Properties
+ $this->properties = array(
+ 'sid' => $payload['sid'],
+ 'friendlyName' => $payload['friendly_name'],
+ 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
+ );
+
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ 'sid' => $sid ?: $this->properties['sid'],
+ );
+ }
+
+ /**
+ * Generate an instance context for the instance, the context is capable of
+ * performing various actions. All instance actions are proxied to the context
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\KeyContext Context for this
+ * KeyInstance
+ */
+ protected function proxy() {
+ if (!$this->context) {
+ $this->context = new KeyContext(
+ $this->version,
+ $this->solution['accountSid'],
+ $this->solution['sid']
+ );
+ }
+
+ return $this->context;
+ }
+
+ /**
+ * Fetch a KeyInstance
+ *
+ * @return KeyInstance Fetched KeyInstance
+ */
+ public function fetch() {
+ return $this->proxy()->fetch();
+ }
+
+ /**
+ * Update the KeyInstance
+ *
+ * @param array $options Optional Arguments
+ * @return KeyInstance Updated KeyInstance
+ */
+ public function update(array $options = array()) {
+ return $this->proxy()->update(
+ $options
+ );
+ }
+
+ /**
+ * Deletes the KeyInstance
+ *
+ * @return boolean True if delete succeeds, false otherwise
+ */
+ public function delete() {
+ return $this->proxy()->delete();
+ }
+
+ /**
+ * Magic getter to access properties
+ *
+ * @param string $name Property to access
+ * @return mixed The requested property
+ * @throws TwilioException For unknown properties
+ */
+ public function __get($name) {
+ if (array_key_exists($name, $this->properties)) {
+ return $this->properties[$name];
+ }
+
+ if (property_exists($this, '_' . $name)) {
+ $method = 'get' . ucfirst($name);
+ return $this->$method();
+ }
+
+ throw new TwilioException('Unknown property: ' . $name);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Api.V2010.KeyInstance ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/CompletedList.php b/Twilio/Rest/Api/V2010/Account/KeyList.php
index dd75edf..064956e 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/CompletedList.php
+++ b/Twilio/Rest/Api/V2010/Account/KeyList.php
@@ -7,30 +7,34 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Api\V2010\Account;
use Twilio\ListResource;
use Twilio\Values;
use Twilio\Version;
-class CompletedList extends ListResource {
+class KeyList extends ListResource {
/**
- * Construct the CompletedList
+ * Construct the KeyList
*
* @param Version $version Version that contains the resource
- * @return \Twilio\Rest\Conversations\V1\Conversation\CompletedList
+ * @param string $accountSid A 34 character string that uniquely identifies
+ * this resource.
+ * @return \Twilio\Rest\Api\V2010\Account\KeyList
*/
- public function __construct(Version $version) {
+ public function __construct(Version $version, $accountSid) {
parent::__construct($version);
// Path Solution
- $this->solution = array();
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ );
- $this->uri = '/Conversations/Completed';
+ $this->uri = '/Accounts/' . $accountSid . '/Keys.json';
}
/**
- * Streams CompletedInstance records from the API as a generator stream.
+ * Streams KeyInstance records from the API as a generator stream.
* This operation lazily loads records as efficiently as possible until the
* limit
* is reached.
@@ -59,7 +63,7 @@ class CompletedList extends ListResource {
}
/**
- * Reads CompletedInstance records from the API as a list.
+ * Reads KeyInstance records from the API as a list.
* Unlike stream(), this operation is eager and will load `limit` records into
* memory before returning.
*
@@ -74,20 +78,20 @@ class CompletedList extends ListResource {
* the
* limit with the most efficient page size, i.e.
* min(limit, 1000)
- * @return CompletedInstance[] Array of results
+ * @return KeyInstance[] Array of results
*/
public function read($limit = null, $pageSize = Values::NONE) {
return iterator_to_array($this->stream($limit, $pageSize));
}
/**
- * Retrieve a single page of CompletedInstance records from the API.
+ * Retrieve a single page of KeyInstance records from the API.
* Request is executed immediately
*
* @param mixed $pageSize Number of records to return, defaults to 50
* @param string $pageToken PageToken provided by the API
* @param mixed $pageNumber Page Number, this value is simply for client state
- * @return \Twilio\Page Page of CompletedInstance
+ * @return \Twilio\Page Page of KeyInstance
*/
public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) {
$params = Values::of(array(
@@ -102,7 +106,21 @@ class CompletedList extends ListResource {
$params
);
- return new CompletedPage($this->version, $response, $this->solution);
+ return new KeyPage($this->version, $response, $this->solution);
+ }
+
+ /**
+ * Constructs a KeyContext
+ *
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Api\V2010\Account\KeyContext
+ */
+ public function getContext($sid) {
+ return new KeyContext(
+ $this->version,
+ $this->solution['accountSid'],
+ $sid
+ );
}
/**
@@ -111,6 +129,6 @@ class CompletedList extends ListResource {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.CompletedList]';
+ return '[Twilio.Api.V2010.KeyList]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php b/Twilio/Rest/Api/V2010/Account/KeyPage.php
index b22e421..18f0151 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php
+++ b/Twilio/Rest/Api/V2010/Account/KeyPage.php
@@ -7,11 +7,11 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Api\V2010\Account;
use Twilio\Page;
-class ParticipantPage extends Page {
+class KeyPage extends Page {
public function __construct($version, $response, $solution) {
parent::__construct($version, $response);
@@ -20,10 +20,10 @@ class ParticipantPage extends Page {
}
public function buildInstance(array $payload) {
- return new ParticipantInstance(
+ return new KeyInstance(
$this->version,
$payload,
- $this->solution['conversationSid']
+ $this->solution['accountSid']
);
}
@@ -33,6 +33,6 @@ class ParticipantPage extends Page {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.ParticipantPage]';
+ return '[Twilio.Api.V2010.KeyPage]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php b/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php
new file mode 100644
index 0000000..ddbac13
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account\Message;
+
+use Twilio\Deserialize;
+use Twilio\Exceptions\TwilioException;
+use Twilio\InstanceResource;
+use Twilio\Version;
+
+/**
+ * @property string accountSid
+ * @property string messageSid
+ * @property string outcome
+ * @property \DateTime dateCreated
+ * @property \DateTime dateUpdated
+ * @property string uri
+ */
+class FeedbackInstance extends InstanceResource {
+ /**
+ * Initialize the FeedbackInstance
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param mixed[] $payload The response payload
+ * @param string $accountSid The account_sid
+ * @param string $messageSid The message_sid
+ * @return \Twilio\Rest\Api\V2010\Account\Message\FeedbackInstance
+ */
+ public function __construct(Version $version, array $payload, $accountSid, $messageSid) {
+ parent::__construct($version);
+
+ // Marshaled Properties
+ $this->properties = array(
+ 'accountSid' => $payload['account_sid'],
+ 'messageSid' => $payload['message_sid'],
+ 'outcome' => $payload['outcome'],
+ 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
+ 'uri' => $payload['uri'],
+ );
+
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ 'messageSid' => $messageSid,
+ );
+ }
+
+ /**
+ * Magic getter to access properties
+ *
+ * @param string $name Property to access
+ * @return mixed The requested property
+ * @throws TwilioException For unknown properties
+ */
+ public function __get($name) {
+ if (array_key_exists($name, $this->properties)) {
+ return $this->properties[$name];
+ }
+
+ if (property_exists($this, '_' . $name)) {
+ $method = 'get' . ucfirst($name);
+ return $this->$method();
+ }
+
+ throw new TwilioException('Unknown property: ' . $name);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.FeedbackInstance]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php b/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php
new file mode 100644
index 0000000..75a91e4
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php
@@ -0,0 +1,73 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account\Message;
+
+use Twilio\ListResource;
+use Twilio\Values;
+use Twilio\Version;
+
+class FeedbackList extends ListResource {
+ /**
+ * Construct the FeedbackList
+ *
+ * @param Version $version Version that contains the resource
+ * @param string $accountSid The account_sid
+ * @param string $messageSid The message_sid
+ * @return \Twilio\Rest\Api\V2010\Account\Message\FeedbackList
+ */
+ public function __construct(Version $version, $accountSid, $messageSid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ 'messageSid' => $messageSid,
+ );
+
+ $this->uri = '/Accounts/' . $accountSid . '/Messages/' . $messageSid . '/Feedback.json';
+ }
+
+ /**
+ * Create a new FeedbackInstance
+ *
+ * @param array $options Optional Arguments
+ * @return FeedbackInstance Newly created FeedbackInstance
+ */
+ public function create(array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'Outcome' => $options['outcome'],
+ ));
+
+ $payload = $this->version->create(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new FeedbackInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid'],
+ $this->solution['messageSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.FeedbackList]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php b/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php
new file mode 100644
index 0000000..8c4c8aa
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account\Message;
+
+use Twilio\Page;
+
+class FeedbackPage extends Page {
+ public function __construct($version, $response, $solution) {
+ parent::__construct($version, $response);
+
+ // Path Solution
+ $this->solution = $solution;
+ }
+
+ public function buildInstance(array $payload) {
+ return new FeedbackInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid'],
+ $this->solution['messageSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.FeedbackPage]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/MessageContext.php b/Twilio/Rest/Api/V2010/Account/MessageContext.php
index 2b1273f..35a5eb4 100644
--- a/Twilio/Rest/Api/V2010/Account/MessageContext.php
+++ b/Twilio/Rest/Api/V2010/Account/MessageContext.php
@@ -11,16 +11,19 @@ namespace Twilio\Rest\Api\V2010\Account;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceContext;
+use Twilio\Rest\Api\V2010\Account\Message\FeedbackList;
use Twilio\Rest\Api\V2010\Account\Message\MediaList;
use Twilio\Values;
use Twilio\Version;
/**
* @property \Twilio\Rest\Api\V2010\Account\Message\MediaList media
+ * @property \Twilio\Rest\Api\V2010\Account\Message\FeedbackList feedback
* @method \Twilio\Rest\Api\V2010\Account\Message\MediaContext media(string $sid)
*/
class MessageContext extends InstanceContext {
protected $_media = null;
+ protected $_feedback = null;
/**
* Initialize the MessageContext
@@ -119,6 +122,23 @@ class MessageContext extends InstanceContext {
}
/**
+ * Access the feedback
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\Message\FeedbackList
+ */
+ protected function getFeedback() {
+ if (!$this->_feedback) {
+ $this->_feedback = new FeedbackList(
+ $this->version,
+ $this->solution['accountSid'],
+ $this->solution['sid']
+ );
+ }
+
+ return $this->_feedback;
+ }
+
+ /**
* Magic getter to lazy load subresources
*
* @param string $name Subresource to return
diff --git a/Twilio/Rest/Api/V2010/Account/MessageInstance.php b/Twilio/Rest/Api/V2010/Account/MessageInstance.php
index 4c8fa97..7cd922e 100644
--- a/Twilio/Rest/Api/V2010/Account/MessageInstance.php
+++ b/Twilio/Rest/Api/V2010/Account/MessageInstance.php
@@ -37,6 +37,7 @@ use Twilio\Version;
*/
class MessageInstance extends InstanceResource {
protected $_media = null;
+ protected $_feedback = null;
/**
* Initialize the MessageInstance
@@ -138,6 +139,15 @@ class MessageInstance extends InstanceResource {
}
/**
+ * Access the feedback
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\Message\FeedbackList
+ */
+ protected function getFeedback() {
+ return $this->proxy()->feedback;
+ }
+
+ /**
* Magic getter to access properties
*
* @param string $name Property to access
diff --git a/Twilio/Rest/Api/V2010/Account/MessageList.php b/Twilio/Rest/Api/V2010/Account/MessageList.php
index 67170c0..8dfd389 100644
--- a/Twilio/Rest/Api/V2010/Account/MessageList.php
+++ b/Twilio/Rest/Api/V2010/Account/MessageList.php
@@ -36,20 +36,22 @@ class MessageList extends ListResource {
* Create a new MessageInstance
*
* @param string $to The phone number to receive the message
- * @param string $from The phone number that initiated the message
* @param array $options Optional Arguments
* @return MessageInstance Newly created MessageInstance
*/
- public function create($to, $from, array $options = array()) {
+ public function create($to, array $options = array()) {
$options = new Values($options);
$data = Values::of(array(
'To' => $to,
- 'From' => $from,
'Body' => $options['body'],
'MediaUrl' => $options['mediaUrl'],
+ 'From' => $options['from'],
+ 'MessagingServiceSid' => $options['messagingServiceSid'],
'StatusCallback' => $options['statusCallback'],
'ApplicationSid' => $options['applicationSid'],
+ 'MaxPrice' => $options['maxPrice'],
+ 'ProvideFeedback' => $options['provideFeedback'],
));
$payload = $this->version->create(
diff --git a/Twilio/Rest/Conversations/V1/Conversation/CompletedInstance.php b/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php
index 2d47212..6a9a855 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/CompletedInstance.php
+++ b/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php
@@ -7,7 +7,7 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Api\V2010\Account;
use Twilio\Deserialize;
use Twilio\Exceptions\TwilioException;
@@ -16,38 +16,36 @@ use Twilio\Version;
/**
* @property string sid
- * @property string status
- * @property string duration
+ * @property string friendlyName
* @property \DateTime dateCreated
- * @property \DateTime startTime
- * @property \DateTime endTime
- * @property string accountSid
- * @property string url
+ * @property \DateTime dateUpdated
+ * @property string secret
*/
-class CompletedInstance extends InstanceResource {
+class NewKeyInstance extends InstanceResource {
/**
- * Initialize the CompletedInstance
+ * Initialize the NewKeyInstance
*
* @param \Twilio\Version $version Version that contains the resource
* @param mixed[] $payload The response payload
- * @return \Twilio\Rest\Conversations\V1\Conversation\CompletedInstance
+ * @param string $accountSid A 34 character string that uniquely identifies
+ * this resource.
+ * @return \Twilio\Rest\Api\V2010\Account\NewKeyInstance
*/
- public function __construct(Version $version, array $payload) {
+ public function __construct(Version $version, array $payload, $accountSid) {
parent::__construct($version);
// Marshaled Properties
$this->properties = array(
'sid' => $payload['sid'],
- 'status' => $payload['status'],
- 'duration' => $payload['duration'],
+ 'friendlyName' => $payload['friendly_name'],
'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
- 'startTime' => Deserialize::iso8601DateTime($payload['start_time']),
- 'endTime' => Deserialize::iso8601DateTime($payload['end_time']),
- 'accountSid' => $payload['account_sid'],
- 'url' => $payload['url'],
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
+ 'secret' => $payload['secret'],
);
- $this->solution = array();
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ );
}
/**
@@ -76,6 +74,6 @@ class CompletedInstance extends InstanceResource {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.CompletedInstance]';
+ return '[Twilio.Api.V2010.NewKeyInstance]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/NewKeyList.php b/Twilio/Rest/Api/V2010/Account/NewKeyList.php
new file mode 100644
index 0000000..44e4dac
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/NewKeyList.php
@@ -0,0 +1,71 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\ListResource;
+use Twilio\Values;
+use Twilio\Version;
+
+class NewKeyList extends ListResource {
+ /**
+ * Construct the NewKeyList
+ *
+ * @param Version $version Version that contains the resource
+ * @param string $accountSid A 34 character string that uniquely identifies
+ * this resource.
+ * @return \Twilio\Rest\Api\V2010\Account\NewKeyList
+ */
+ public function __construct(Version $version, $accountSid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ );
+
+ $this->uri = '/Accounts/' . $accountSid . '/Keys.json';
+ }
+
+ /**
+ * Create a new NewKeyInstance
+ *
+ * @param array $options Optional Arguments
+ * @return NewKeyInstance Newly created NewKeyInstance
+ */
+ public function create(array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'FriendlyName' => $options['friendlyName'],
+ ));
+
+ $payload = $this->version->create(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new NewKeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.NewKeyList]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/NewKeyPage.php b/Twilio/Rest/Api/V2010/Account/NewKeyPage.php
new file mode 100644
index 0000000..75dda8f
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/NewKeyPage.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\Page;
+
+class NewKeyPage extends Page {
+ public function __construct($version, $response, $solution) {
+ parent::__construct($version, $response);
+
+ // Path Solution
+ $this->solution = $solution;
+ }
+
+ public function buildInstance(array $payload) {
+ return new NewKeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.NewKeyPage]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/InProgressInstance.php b/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php
index 29396a9..dc4e722 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/InProgressInstance.php
+++ b/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php
@@ -7,7 +7,7 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Api\V2010\Account;
use Twilio\Deserialize;
use Twilio\Exceptions\TwilioException;
@@ -16,38 +16,36 @@ use Twilio\Version;
/**
* @property string sid
- * @property string status
- * @property string duration
+ * @property string friendlyName
* @property \DateTime dateCreated
- * @property \DateTime startTime
- * @property \DateTime endTime
- * @property string accountSid
- * @property string url
+ * @property \DateTime dateUpdated
+ * @property string secret
*/
-class InProgressInstance extends InstanceResource {
+class NewSigningKeyInstance extends InstanceResource {
/**
- * Initialize the InProgressInstance
+ * Initialize the NewSigningKeyInstance
*
* @param \Twilio\Version $version Version that contains the resource
* @param mixed[] $payload The response payload
- * @return \Twilio\Rest\Conversations\V1\Conversation\InProgressInstance
+ * @param string $accountSid A 34 character string that uniquely identifies
+ * this resource.
+ * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyInstance
*/
- public function __construct(Version $version, array $payload) {
+ public function __construct(Version $version, array $payload, $accountSid) {
parent::__construct($version);
// Marshaled Properties
$this->properties = array(
'sid' => $payload['sid'],
- 'status' => $payload['status'],
- 'duration' => $payload['duration'],
+ 'friendlyName' => $payload['friendly_name'],
'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
- 'startTime' => Deserialize::iso8601DateTime($payload['start_time']),
- 'endTime' => Deserialize::iso8601DateTime($payload['end_time']),
- 'accountSid' => $payload['account_sid'],
- 'url' => $payload['url'],
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
+ 'secret' => $payload['secret'],
);
- $this->solution = array();
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ );
}
/**
@@ -76,6 +74,6 @@ class InProgressInstance extends InstanceResource {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.InProgressInstance]';
+ return '[Twilio.Api.V2010.NewSigningKeyInstance]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php b/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php
new file mode 100644
index 0000000..8ba748f
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php
@@ -0,0 +1,71 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\ListResource;
+use Twilio\Values;
+use Twilio\Version;
+
+class NewSigningKeyList extends ListResource {
+ /**
+ * Construct the NewSigningKeyList
+ *
+ * @param Version $version Version that contains the resource
+ * @param string $accountSid A 34 character string that uniquely identifies
+ * this resource.
+ * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList
+ */
+ public function __construct(Version $version, $accountSid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ );
+
+ $this->uri = '/Accounts/' . $accountSid . '/SigningKeys.json';
+ }
+
+ /**
+ * Create a new NewSigningKeyInstance
+ *
+ * @param array $options Optional Arguments
+ * @return NewSigningKeyInstance Newly created NewSigningKeyInstance
+ */
+ public function create(array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'FriendlyName' => $options['friendlyName'],
+ ));
+
+ $payload = $this->version->create(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new NewSigningKeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.NewSigningKeyList]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php b/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php
new file mode 100644
index 0000000..68333b0
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\Page;
+
+class NewSigningKeyPage extends Page {
+ public function __construct($version, $response, $solution) {
+ parent::__construct($version, $response);
+
+ // Path Solution
+ $this->solution = $solution;
+ }
+
+ public function buildInstance(array $payload) {
+ return new NewSigningKeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.NewSigningKeyPage]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php b/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php
new file mode 100644
index 0000000..b5aa34e
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php
@@ -0,0 +1,108 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\InstanceContext;
+use Twilio\Values;
+use Twilio\Version;
+
+class SigningKeyContext extends InstanceContext {
+ /**
+ * Initialize the SigningKeyContext
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param string $accountSid The account_sid
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext
+ */
+ public function __construct(Version $version, $accountSid, $sid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ 'sid' => $sid,
+ );
+
+ $this->uri = '/Accounts/' . $accountSid . '/SigningKeys/' . $sid . '.json';
+ }
+
+ /**
+ * Fetch a SigningKeyInstance
+ *
+ * @return SigningKeyInstance Fetched SigningKeyInstance
+ */
+ public function fetch() {
+ $params = Values::of(array());
+
+ $payload = $this->version->fetch(
+ 'GET',
+ $this->uri,
+ $params
+ );
+
+ return new SigningKeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid'],
+ $this->solution['sid']
+ );
+ }
+
+ /**
+ * Update the SigningKeyInstance
+ *
+ * @param array $options Optional Arguments
+ * @return SigningKeyInstance Updated SigningKeyInstance
+ */
+ public function update(array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'FriendlyName' => $options['friendlyName'],
+ ));
+
+ $payload = $this->version->update(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new SigningKeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid'],
+ $this->solution['sid']
+ );
+ }
+
+ /**
+ * Deletes the SigningKeyInstance
+ *
+ * @return boolean True if delete succeeds, false otherwise
+ */
+ public function delete() {
+ return $this->version->delete('delete', $this->uri);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Api.V2010.SigningKeyContext ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php b/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php
new file mode 100644
index 0000000..3308d97
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php
@@ -0,0 +1,132 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\Deserialize;
+use Twilio\Exceptions\TwilioException;
+use Twilio\InstanceResource;
+use Twilio\Version;
+
+/**
+ * @property string sid
+ * @property string friendlyName
+ * @property \DateTime dateCreated
+ * @property \DateTime dateUpdated
+ */
+class SigningKeyInstance extends InstanceResource {
+ /**
+ * Initialize the SigningKeyInstance
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param mixed[] $payload The response payload
+ * @param string $accountSid A 34 character string that uniquely identifies
+ * this resource.
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyInstance
+ */
+ public function __construct(Version $version, array $payload, $accountSid, $sid = null) {
+ parent::__construct($version);
+
+ // Marshaled Properties
+ $this->properties = array(
+ 'sid' => $payload['sid'],
+ 'friendlyName' => $payload['friendly_name'],
+ 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
+ );
+
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ 'sid' => $sid ?: $this->properties['sid'],
+ );
+ }
+
+ /**
+ * Generate an instance context for the instance, the context is capable of
+ * performing various actions. All instance actions are proxied to the context
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext Context for this
+ * SigningKeyInstance
+ */
+ protected function proxy() {
+ if (!$this->context) {
+ $this->context = new SigningKeyContext(
+ $this->version,
+ $this->solution['accountSid'],
+ $this->solution['sid']
+ );
+ }
+
+ return $this->context;
+ }
+
+ /**
+ * Fetch a SigningKeyInstance
+ *
+ * @return SigningKeyInstance Fetched SigningKeyInstance
+ */
+ public function fetch() {
+ return $this->proxy()->fetch();
+ }
+
+ /**
+ * Update the SigningKeyInstance
+ *
+ * @param array $options Optional Arguments
+ * @return SigningKeyInstance Updated SigningKeyInstance
+ */
+ public function update(array $options = array()) {
+ return $this->proxy()->update(
+ $options
+ );
+ }
+
+ /**
+ * Deletes the SigningKeyInstance
+ *
+ * @return boolean True if delete succeeds, false otherwise
+ */
+ public function delete() {
+ return $this->proxy()->delete();
+ }
+
+ /**
+ * Magic getter to access properties
+ *
+ * @param string $name Property to access
+ * @return mixed The requested property
+ * @throws TwilioException For unknown properties
+ */
+ public function __get($name) {
+ if (array_key_exists($name, $this->properties)) {
+ return $this->properties[$name];
+ }
+
+ if (property_exists($this, '_' . $name)) {
+ $method = 'get' . ucfirst($name);
+ return $this->$method();
+ }
+
+ throw new TwilioException('Unknown property: ' . $name);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Api.V2010.SigningKeyInstance ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/SigningKeyList.php b/Twilio/Rest/Api/V2010/Account/SigningKeyList.php
new file mode 100644
index 0000000..5b0cacf
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/SigningKeyList.php
@@ -0,0 +1,134 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\ListResource;
+use Twilio\Values;
+use Twilio\Version;
+
+class SigningKeyList extends ListResource {
+ /**
+ * Construct the SigningKeyList
+ *
+ * @param Version $version Version that contains the resource
+ * @param string $accountSid A 34 character string that uniquely identifies
+ * this resource.
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList
+ */
+ public function __construct(Version $version, $accountSid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'accountSid' => $accountSid,
+ );
+
+ $this->uri = '/Accounts/' . $accountSid . '/SigningKeys.json';
+ }
+
+ /**
+ * Streams SigningKeyInstance records from the API as a generator stream.
+ * This operation lazily loads records as efficiently as possible until the
+ * limit
+ * is reached.
+ * The results are returned as a generator, so this operation is memory
+ * efficient.
+ *
+ * @param int $limit Upper limit for the number of records to return. stream()
+ * guarantees to never return more than limit. Default is no
+ * limit
+ * @param mixed $pageSize Number of records to fetch per request, when not set
+ * will use
+ * the default value of 50 records. If no page_size is
+ * defined
+ * but a limit is defined, stream() will attempt to read
+ * the limit
+ * with the most efficient page size, i.e. min(limit,
+ * 1000)
+ * @return \Twilio\Stream stream of results
+ */
+ public function stream($limit = null, $pageSize = null) {
+ $limits = $this->version->readLimits($limit, $pageSize);
+
+ $page = $this->page($limits['pageSize']);
+
+ return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
+ }
+
+ /**
+ * Reads SigningKeyInstance records from the API as a list.
+ * Unlike stream(), this operation is eager and will load `limit` records into
+ * memory before returning.
+ *
+ * @param int $limit Upper limit for the number of records to return. read()
+ * guarantees to never return more than limit. Default is no
+ * limit
+ * @param mixed $pageSize Number of records to fetch per request, when not set
+ * will use
+ * the default value of 50 records. If no page_size is
+ * defined
+ * but a limit is defined, read() will attempt to read
+ * the
+ * limit with the most efficient page size, i.e.
+ * min(limit, 1000)
+ * @return SigningKeyInstance[] Array of results
+ */
+ public function read($limit = null, $pageSize = Values::NONE) {
+ return iterator_to_array($this->stream($limit, $pageSize));
+ }
+
+ /**
+ * Retrieve a single page of SigningKeyInstance records from the API.
+ * Request is executed immediately
+ *
+ * @param mixed $pageSize Number of records to return, defaults to 50
+ * @param string $pageToken PageToken provided by the API
+ * @param mixed $pageNumber Page Number, this value is simply for client state
+ * @return \Twilio\Page Page of SigningKeyInstance
+ */
+ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) {
+ $params = Values::of(array(
+ 'PageToken' => $pageToken,
+ 'Page' => $pageNumber,
+ 'PageSize' => $pageSize,
+ ));
+
+ $response = $this->version->page(
+ 'GET',
+ $this->uri,
+ $params
+ );
+
+ return new SigningKeyPage($this->version, $response, $this->solution);
+ }
+
+ /**
+ * Constructs a SigningKeyContext
+ *
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext
+ */
+ public function getContext($sid) {
+ return new SigningKeyContext(
+ $this->version,
+ $this->solution['accountSid'],
+ $sid
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.SigningKeyList]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php b/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php
new file mode 100644
index 0000000..e03a111
--- /dev/null
+++ b/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Api\V2010\Account;
+
+use Twilio\Page;
+
+class SigningKeyPage extends Page {
+ public function __construct($version, $response, $solution) {
+ parent::__construct($version, $response);
+
+ // Path Solution
+ $this->solution = $solution;
+ }
+
+ public function buildInstance(array $payload) {
+ return new SigningKeyInstance(
+ $this->version,
+ $payload,
+ $this->solution['accountSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Api.V2010.SigningKeyPage]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php b/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php
index 24f7db4..3100787 100644
--- a/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php
+++ b/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php
@@ -78,7 +78,7 @@ class DomainContext extends InstanceContext {
$options = new Values($options);
$data = Values::of(array(
- 'ApiVersion' => $options['apiVersion'],
+ 'AuthType' => $options['authType'],
'FriendlyName' => $options['friendlyName'],
'VoiceFallbackMethod' => $options['voiceFallbackMethod'],
'VoiceFallbackUrl' => $options['voiceFallbackUrl'],
diff --git a/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php b/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php
index c0eea5f..41d62ba 100644
--- a/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php
+++ b/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php
@@ -122,6 +122,7 @@ class DomainList extends ListResource {
$data = Values::of(array(
'DomainName' => $domainName,
'FriendlyName' => $options['friendlyName'],
+ 'AuthType' => $options['authType'],
'VoiceUrl' => $options['voiceUrl'],
'VoiceMethod' => $options['voiceMethod'],
'VoiceFallbackUrl' => $options['voiceFallbackUrl'],
diff --git a/Twilio/Rest/Api/V2010/AccountContext.php b/Twilio/Rest/Api/V2010/AccountContext.php
index 0e71764..bea99ba 100644
--- a/Twilio/Rest/Api/V2010/AccountContext.php
+++ b/Twilio/Rest/Api/V2010/AccountContext.php
@@ -19,12 +19,16 @@ use Twilio\Rest\Api\V2010\Account\CallList;
use Twilio\Rest\Api\V2010\Account\ConferenceList;
use Twilio\Rest\Api\V2010\Account\ConnectAppList;
use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList;
+use Twilio\Rest\Api\V2010\Account\KeyList;
use Twilio\Rest\Api\V2010\Account\MessageList;
+use Twilio\Rest\Api\V2010\Account\NewKeyList;
+use Twilio\Rest\Api\V2010\Account\NewSigningKeyList;
use Twilio\Rest\Api\V2010\Account\NotificationList;
use Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList;
use Twilio\Rest\Api\V2010\Account\QueueList;
use Twilio\Rest\Api\V2010\Account\RecordingList;
use Twilio\Rest\Api\V2010\Account\SandboxList;
+use Twilio\Rest\Api\V2010\Account\SigningKeyList;
use Twilio\Rest\Api\V2010\Account\SipList;
use Twilio\Rest\Api\V2010\Account\SmsList;
use Twilio\Rest\Api\V2010\Account\TokenList;
@@ -43,12 +47,16 @@ use Twilio\Version;
* @property \Twilio\Rest\Api\V2010\Account\ConferenceList conferences
* @property \Twilio\Rest\Api\V2010\Account\ConnectAppList connectApps
* @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList incomingPhoneNumbers
+ * @property \Twilio\Rest\Api\V2010\Account\KeyList keys
* @property \Twilio\Rest\Api\V2010\Account\MessageList messages
+ * @property \Twilio\Rest\Api\V2010\Account\NewKeyList newKeys
+ * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList newSigningKeys
* @property \Twilio\Rest\Api\V2010\Account\NotificationList notifications
* @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList outgoingCallerIds
* @property \Twilio\Rest\Api\V2010\Account\QueueList queues
* @property \Twilio\Rest\Api\V2010\Account\RecordingList recordings
* @property \Twilio\Rest\Api\V2010\Account\SandboxList sandbox
+ * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList signingKeys
* @property \Twilio\Rest\Api\V2010\Account\SipList sip
* @property \Twilio\Rest\Api\V2010\Account\SmsList sms
* @property \Twilio\Rest\Api\V2010\Account\TokenList tokens
@@ -63,12 +71,14 @@ use Twilio\Version;
* @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid)
+ * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\SandboxContext sandbox()
+ * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid)
*/
class AccountContext extends InstanceContext {
@@ -80,12 +90,16 @@ class AccountContext extends InstanceContext {
protected $_conferences = null;
protected $_connectApps = null;
protected $_incomingPhoneNumbers = null;
+ protected $_keys = null;
protected $_messages = null;
+ protected $_newKeys = null;
+ protected $_newSigningKeys = null;
protected $_notifications = null;
protected $_outgoingCallerIds = null;
protected $_queues = null;
protected $_recordings = null;
protected $_sandbox = null;
+ protected $_signingKeys = null;
protected $_sip = null;
protected $_sms = null;
protected $_tokens = null;
@@ -289,6 +303,22 @@ class AccountContext extends InstanceContext {
}
/**
+ * Access the keys
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\KeyList
+ */
+ protected function getKeys() {
+ if (!$this->_keys) {
+ $this->_keys = new KeyList(
+ $this->version,
+ $this->solution['sid']
+ );
+ }
+
+ return $this->_keys;
+ }
+
+ /**
* Access the messages
*
* @return \Twilio\Rest\Api\V2010\Account\MessageList
@@ -305,6 +335,38 @@ class AccountContext extends InstanceContext {
}
/**
+ * Access the newKeys
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\NewKeyList
+ */
+ protected function getNewKeys() {
+ if (!$this->_newKeys) {
+ $this->_newKeys = new NewKeyList(
+ $this->version,
+ $this->solution['sid']
+ );
+ }
+
+ return $this->_newKeys;
+ }
+
+ /**
+ * Access the newSigningKeys
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList
+ */
+ protected function getNewSigningKeys() {
+ if (!$this->_newSigningKeys) {
+ $this->_newSigningKeys = new NewSigningKeyList(
+ $this->version,
+ $this->solution['sid']
+ );
+ }
+
+ return $this->_newSigningKeys;
+ }
+
+ /**
* Access the notifications
*
* @return \Twilio\Rest\Api\V2010\Account\NotificationList
@@ -385,6 +447,22 @@ class AccountContext extends InstanceContext {
}
/**
+ * Access the signingKeys
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList
+ */
+ protected function getSigningKeys() {
+ if (!$this->_signingKeys) {
+ $this->_signingKeys = new SigningKeyList(
+ $this->version,
+ $this->solution['sid']
+ );
+ }
+
+ return $this->_signingKeys;
+ }
+
+ /**
* Access the sip
*
* @return \Twilio\Rest\Api\V2010\Account\SipList
diff --git a/Twilio/Rest/Api/V2010/AccountInstance.php b/Twilio/Rest/Api/V2010/AccountInstance.php
index 981d389..0d028a1 100644
--- a/Twilio/Rest/Api/V2010/AccountInstance.php
+++ b/Twilio/Rest/Api/V2010/AccountInstance.php
@@ -35,12 +35,16 @@ class AccountInstance extends InstanceResource {
protected $_conferences = null;
protected $_connectApps = null;
protected $_incomingPhoneNumbers = null;
+ protected $_keys = null;
protected $_messages = null;
+ protected $_newKeys = null;
+ protected $_newSigningKeys = null;
protected $_notifications = null;
protected $_outgoingCallerIds = null;
protected $_queues = null;
protected $_recordings = null;
protected $_sandbox = null;
+ protected $_signingKeys = null;
protected $_sip = null;
protected $_sms = null;
protected $_tokens = null;
@@ -190,6 +194,15 @@ class AccountInstance extends InstanceResource {
}
/**
+ * Access the keys
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\KeyList
+ */
+ protected function getKeys() {
+ return $this->proxy()->keys;
+ }
+
+ /**
* Access the messages
*
* @return \Twilio\Rest\Api\V2010\Account\MessageList
@@ -199,6 +212,24 @@ class AccountInstance extends InstanceResource {
}
/**
+ * Access the newKeys
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\NewKeyList
+ */
+ protected function getNewKeys() {
+ return $this->proxy()->newKeys;
+ }
+
+ /**
+ * Access the newSigningKeys
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList
+ */
+ protected function getNewSigningKeys() {
+ return $this->proxy()->newSigningKeys;
+ }
+
+ /**
* Access the notifications
*
* @return \Twilio\Rest\Api\V2010\Account\NotificationList
@@ -244,6 +275,15 @@ class AccountInstance extends InstanceResource {
}
/**
+ * Access the signingKeys
+ *
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList
+ */
+ protected function getSigningKeys() {
+ return $this->proxy()->signingKeys;
+ }
+
+ /**
* Access the sip
*
* @return \Twilio\Rest\Api\V2010\Account\SipList
diff --git a/Twilio/Rest/Client.php b/Twilio/Rest/Client.php
index aa423b6..b27b024 100644
--- a/Twilio/Rest/Client.php
+++ b/Twilio/Rest/Client.php
@@ -19,11 +19,11 @@ use Twilio\VersionInfo;
* A client for accessing the Twilio API.
*
* @property \Twilio\Rest\Api api
- * @property \Twilio\Rest\Conversations conversations
* @property \Twilio\Rest\IpMessaging ipMessaging
* @property \Twilio\Rest\Lookups lookups
* @property \Twilio\Rest\Monitor monitor
* @property \Twilio\Rest\Notifications notifications
+ * @property \Twilio\Rest\Preview preview
* @property \Twilio\Rest\Pricing pricing
* @property \Twilio\Rest\Taskrouter taskrouter
* @property \Twilio\Rest\Trunking trunking
@@ -35,11 +35,15 @@ use Twilio\VersionInfo;
* @property \Twilio\Rest\Api\V2010\Account\ConferenceList conferences
* @property \Twilio\Rest\Api\V2010\Account\ConnectAppList connectApps
* @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList incomingPhoneNumbers
+ * @property \Twilio\Rest\Api\V2010\Account\KeyList keys
* @property \Twilio\Rest\Api\V2010\Account\MessageList messages
+ * @property \Twilio\Rest\Api\V2010\Account\NewKeyList newKeys
+ * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList newSigningKeys
* @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList outgoingCallerIds
* @property \Twilio\Rest\Api\V2010\Account\QueueList queues
* @property \Twilio\Rest\Api\V2010\Account\RecordingList recordings
* @property \Twilio\Rest\Api\V2010\Account\SandboxList sandbox
+ * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList signingKeys
* @property \Twilio\Rest\Api\V2010\Account\SipList sip
* @property \Twilio\Rest\Api\V2010\Account\SmsList sms
* @property \Twilio\Rest\Api\V2010\Account\TokenList tokens
@@ -54,11 +58,13 @@ use Twilio\VersionInfo;
* @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid)
+ * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\SandboxContext sandbox()
+ * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid)
* @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid)
*/
class Client {
@@ -69,12 +75,13 @@ class Client {
protected $password;
protected $accountSid;
protected $httpClient;
+ protected $_account;
protected $_api = null;
- protected $_conversations = null;
protected $_ipMessaging = null;
protected $_lookups = null;
protected $_monitor = null;
protected $_notifications = null;
+ protected $_preview = null;
protected $_pricing = null;
protected $_taskrouter = null;
protected $_trunking = null;
@@ -87,11 +94,15 @@ class Client {
protected $_conferences = null;
protected $_connectApps = null;
protected $_incomingPhoneNumbers = null;
+ protected $_keys = null;
protected $_messages = null;
+ protected $_newKeys = null;
+ protected $_newSigningKeys = null;
protected $_outgoingCallerIds = null;
protected $_queues = null;
protected $_recordings = null;
protected $_sandbox = null;
+ protected $_signingKeys = null;
protected $_sip = null;
protected $_sms = null;
protected $_tokens = null;
@@ -231,7 +242,7 @@ class Client {
* @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the
* authenticating account
*/
- public function account() {
+ public function getAccount() {
return $this->api->v2010->account;
}
@@ -299,6 +310,13 @@ class Client {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\KeyList
+ */
+ public function getKeys() {
+ return $this->api->v2010->account->keys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\MessageList
*/
public function getMessages() {
@@ -306,6 +324,20 @@ class Client {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\NewKeyList
+ */
+ public function getNewKeys() {
+ return $this->api->v2010->account->newKeys;
+ }
+
+ /**
+ * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList
+ */
+ public function getNewSigningKeys() {
+ return $this->api->v2010->account->newSigningKeys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList
*/
public function getOutgoingCallerIds() {
@@ -334,6 +366,13 @@ class Client {
}
/**
+ * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList
+ */
+ public function getSigningKeys() {
+ return $this->api->v2010->account->signingKeys;
+ }
+
+ /**
* @return \Twilio\Rest\Api\V2010\Account\SipList
*/
public function getSip() {
@@ -376,18 +415,6 @@ class Client {
}
/**
- * Access the Conversations Twilio Domain
- *
- * @return \Twilio\Rest\Conversations Conversations Twilio Domain
- */
- protected function getConversations() {
- if (!$this->_conversations) {
- $this->_conversations = new Conversations($this);
- }
- return $this->_conversations;
- }
-
- /**
* Access the IpMessaging Twilio Domain
*
* @return \Twilio\Rest\IpMessaging IpMessaging Twilio Domain
@@ -436,6 +463,18 @@ class Client {
}
/**
+ * Access the Preview Twilio Domain
+ *
+ * @return \Twilio\Rest\Preview Preview Twilio Domain
+ */
+ protected function getPreview() {
+ if (!$this->_preview) {
+ $this->_preview = new Preview($this);
+ }
+ return $this->_preview;
+ }
+
+ /**
* Access the Pricing Twilio Domain
*
* @return \Twilio\Rest\Pricing Pricing Twilio Domain
diff --git a/Twilio/Rest/Conversations/V1/ConversationList.php b/Twilio/Rest/Conversations/V1/ConversationList.php
deleted file mode 100644
index bb22ac9..0000000
--- a/Twilio/Rest/Conversations/V1/ConversationList.php
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-
-/**
- * This code was generated by
- * \ / _ _ _| _ _
- * | (_)\/(_)(_|\/| |(/_ v1.0.0
- * / /
- */
-
-namespace Twilio\Rest\Conversations\V1;
-
-use Twilio\Exceptions\TwilioException;
-use Twilio\ListResource;
-use Twilio\Rest\Conversations\V1\Conversation\CompletedList;
-use Twilio\Rest\Conversations\V1\Conversation\InProgressList;
-use Twilio\Version;
-
-/**
- * @property \Twilio\Rest\Conversations\V1\Conversation\InProgressList inProgress
- * @property \Twilio\Rest\Conversations\V1\Conversation\CompletedList completed
- */
-class ConversationList extends ListResource {
- protected $_inProgress = null;
- protected $_completed = null;
-
- /**
- * Construct the ConversationList
- *
- * @param Version $version Version that contains the resource
- * @return \Twilio\Rest\Conversations\V1\ConversationList
- */
- public function __construct(Version $version) {
- parent::__construct($version);
-
- // Path Solution
- $this->solution = array();
- }
-
- /**
- * Access the inProgress
- */
- protected function getInProgress() {
- if (!$this->_inProgress) {
- $this->_inProgress = new InProgressList(
- $this->version
- );
- }
-
- return $this->_inProgress;
- }
-
- /**
- * Access the completed
- */
- protected function getCompleted() {
- if (!$this->_completed) {
- $this->_completed = new CompletedList(
- $this->version
- );
- }
-
- return $this->_completed;
- }
-
- /**
- * Constructs a ConversationContext
- *
- * @param string $sid The sid
- * @return \Twilio\Rest\Conversations\V1\ConversationContext
- */
- public function getContext($sid) {
- return new ConversationContext(
- $this->version,
- $sid
- );
- }
-
- /**
- * Magic getter to lazy load subresources
- *
- * @param string $name Subresource to return
- * @return \Twilio\ListResource The requested subresource
- * @throws \Twilio\Exceptions\TwilioException For unknown subresources
- */
- public function __get($name) {
- if (property_exists($this, '_' . $name)) {
- $method = 'get' . ucfirst($name);
- return $this->$method();
- }
-
- throw new TwilioException('Unknown subresource ' . $name);
- }
-
- /**
- * Magic caller to get resource contexts
- *
- * @param string $name Resource to return
- * @param array $arguments Context parameters
- * @return \Twilio\InstanceContext The requested resource context
- * @throws \Twilio\Exceptions\TwilioException For unknown resource
- */
- public function __call($name, $arguments) {
- $property = $this->$name;
- if (method_exists($property, 'getContext')) {
- return call_user_func_array(array($property, 'getContext'), $arguments);
- }
-
- throw new TwilioException('Resource does not have a context');
- }
-
- /**
- * Provide a friendly representation
- *
- * @return string Machine friendly representation
- */
- public function __toString() {
- return '[Twilio.Conversations.V1.ConversationList]';
- }
-} \ No newline at end of file
diff --git a/Twilio/Rest/Lookups/V1/PhoneNumberContext.php b/Twilio/Rest/Lookups/V1/PhoneNumberContext.php
index f53662e..7463005 100644
--- a/Twilio/Rest/Lookups/V1/PhoneNumberContext.php
+++ b/Twilio/Rest/Lookups/V1/PhoneNumberContext.php
@@ -10,6 +10,7 @@
namespace Twilio\Rest\Lookups\V1;
use Twilio\InstanceContext;
+use Twilio\Serialize;
use Twilio\Values;
use Twilio\Version;
@@ -44,8 +45,10 @@ class PhoneNumberContext extends InstanceContext {
$params = Values::of(array(
'CountryCode' => $options['countryCode'],
'Type' => $options['type'],
+ 'AddOns' => $options['addOns'],
));
+ $params = array_merge($params, Serialize::prefixedCollapsibleMap($options['addOnsData'], 'AddOns'));
$payload = $this->version->fetch(
'GET',
$this->uri,
diff --git a/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php b/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php
index 9429744..06a201c 100644
--- a/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php
+++ b/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php
@@ -11,6 +11,7 @@ namespace Twilio\Rest\Lookups\V1;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceResource;
+use Twilio\Serialize;
use Twilio\Version;
/**
@@ -18,6 +19,7 @@ use Twilio\Version;
* @property string phoneNumber
* @property string nationalFormat
* @property string carrier
+ * @property string addOns
*/
class PhoneNumberInstance extends InstanceResource {
/**
@@ -37,6 +39,7 @@ class PhoneNumberInstance extends InstanceResource {
'phoneNumber' => $payload['phone_number'],
'nationalFormat' => $payload['national_format'],
'carrier' => $payload['carrier'],
+ 'addOns' => $payload['add_ons'],
);
$this->solution = array(
diff --git a/Twilio/Rest/Notifications.php b/Twilio/Rest/Notifications.php
index 9550107..ade6fc8 100644
--- a/Twilio/Rest/Notifications.php
+++ b/Twilio/Rest/Notifications.php
@@ -76,6 +76,13 @@ class Notifications extends Domain {
}
/**
+ * @return \Twilio\Rest\Notifications\V1\CredentialList
+ */
+ public function credentials() {
+ return $this->v1->credentials;
+ }
+
+ /**
* @return \Twilio\Rest\Notifications\V1\ServiceList
*/
public function services() {
diff --git a/Twilio/Rest/Notifications/V1.php b/Twilio/Rest/Notifications/V1.php
index 8536c22..5ed028f 100644
--- a/Twilio/Rest/Notifications/V1.php
+++ b/Twilio/Rest/Notifications/V1.php
@@ -11,14 +11,18 @@ namespace Twilio\Rest\Notifications;
use Twilio\Domain;
use Twilio\Exceptions\TwilioException;
+use Twilio\Rest\Notifications\V1\CredentialList;
use Twilio\Rest\Notifications\V1\ServiceList;
use Twilio\Version;
/**
+ * @property \Twilio\Rest\Notifications\V1\CredentialList credentials
* @property \Twilio\Rest\Notifications\V1\ServiceList services
+ * @method \Twilio\Rest\Notifications\V1\CredentialContext credentials(string $sid)
* @method \Twilio\Rest\Notifications\V1\ServiceContext services(string $sid)
*/
class V1 extends Version {
+ protected $_credentials = null;
protected $_services = null;
/**
@@ -33,6 +37,16 @@ class V1 extends Version {
}
/**
+ * @return \Twilio\Rest\Notifications\V1\CredentialList
+ */
+ protected function getCredentials() {
+ if (!$this->_credentials) {
+ $this->_credentials = new CredentialList($this);
+ }
+ return $this->_credentials;
+ }
+
+ /**
* @return \Twilio\Rest\Notifications\V1\ServiceList
*/
protected function getServices() {
diff --git a/Twilio/Rest/Notifications/V1/CredentialContext.php b/Twilio/Rest/Notifications/V1/CredentialContext.php
new file mode 100644
index 0000000..f9fd518
--- /dev/null
+++ b/Twilio/Rest/Notifications/V1/CredentialContext.php
@@ -0,0 +1,111 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Notifications\V1;
+
+use Twilio\InstanceContext;
+use Twilio\Values;
+use Twilio\Version;
+
+class CredentialContext extends InstanceContext {
+ /**
+ * Initialize the CredentialContext
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Notifications\V1\CredentialContext
+ */
+ public function __construct(Version $version, $sid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'sid' => $sid,
+ );
+
+ $this->uri = '/Credentials/' . $sid . '';
+ }
+
+ /**
+ * Fetch a CredentialInstance
+ *
+ * @return CredentialInstance Fetched CredentialInstance
+ */
+ public function fetch() {
+ $params = Values::of(array());
+
+ $payload = $this->version->fetch(
+ 'GET',
+ $this->uri,
+ $params
+ );
+
+ return new CredentialInstance(
+ $this->version,
+ $payload,
+ $this->solution['sid']
+ );
+ }
+
+ /**
+ * Update the CredentialInstance
+ *
+ * @param string $friendlyName The friendly_name
+ * @param string $type The type
+ * @param array $options Optional Arguments
+ * @return CredentialInstance Updated CredentialInstance
+ */
+ public function update($friendlyName, $type, array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'FriendlyName' => $friendlyName,
+ 'Type' => $type,
+ 'Certificate' => $options['certificate'],
+ 'PrivateKey' => $options['privateKey'],
+ 'Sandbox' => $options['sandbox'],
+ 'ApiKey' => $options['apiKey'],
+ ));
+
+ $payload = $this->version->update(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new CredentialInstance(
+ $this->version,
+ $payload,
+ $this->solution['sid']
+ );
+ }
+
+ /**
+ * Deletes the CredentialInstance
+ *
+ * @return boolean True if delete succeeds, false otherwise
+ */
+ public function delete() {
+ return $this->version->delete('delete', $this->uri);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Notifications.V1.CredentialContext ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Notifications/V1/CredentialInstance.php b/Twilio/Rest/Notifications/V1/CredentialInstance.php
new file mode 100644
index 0000000..b12233e
--- /dev/null
+++ b/Twilio/Rest/Notifications/V1/CredentialInstance.php
@@ -0,0 +1,140 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Notifications\V1;
+
+use Twilio\Deserialize;
+use Twilio\Exceptions\TwilioException;
+use Twilio\InstanceResource;
+use Twilio\Version;
+
+/**
+ * @property string sid
+ * @property string accountSid
+ * @property string friendlyName
+ * @property string type
+ * @property string sandbox
+ * @property \DateTime dateCreated
+ * @property \DateTime dateUpdated
+ * @property string url
+ */
+class CredentialInstance extends InstanceResource {
+ /**
+ * Initialize the CredentialInstance
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param mixed[] $payload The response payload
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Notifications\V1\CredentialInstance
+ */
+ public function __construct(Version $version, array $payload, $sid = null) {
+ parent::__construct($version);
+
+ // Marshaled Properties
+ $this->properties = array(
+ 'sid' => $payload['sid'],
+ 'accountSid' => $payload['account_sid'],
+ 'friendlyName' => $payload['friendly_name'],
+ 'type' => $payload['type'],
+ 'sandbox' => $payload['sandbox'],
+ 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
+ 'url' => $payload['url'],
+ );
+
+ $this->solution = array(
+ 'sid' => $sid ?: $this->properties['sid'],
+ );
+ }
+
+ /**
+ * Generate an instance context for the instance, the context is capable of
+ * performing various actions. All instance actions are proxied to the context
+ *
+ * @return \Twilio\Rest\Notifications\V1\CredentialContext Context for this
+ * CredentialInstance
+ */
+ protected function proxy() {
+ if (!$this->context) {
+ $this->context = new CredentialContext(
+ $this->version,
+ $this->solution['sid']
+ );
+ }
+
+ return $this->context;
+ }
+
+ /**
+ * Fetch a CredentialInstance
+ *
+ * @return CredentialInstance Fetched CredentialInstance
+ */
+ public function fetch() {
+ return $this->proxy()->fetch();
+ }
+
+ /**
+ * Update the CredentialInstance
+ *
+ * @param string $friendlyName The friendly_name
+ * @param string $type The type
+ * @param array $options Optional Arguments
+ * @return CredentialInstance Updated CredentialInstance
+ */
+ public function update($friendlyName, $type, array $options = array()) {
+ return $this->proxy()->update(
+ $friendlyName,
+ $type,
+ $options
+ );
+ }
+
+ /**
+ * Deletes the CredentialInstance
+ *
+ * @return boolean True if delete succeeds, false otherwise
+ */
+ public function delete() {
+ return $this->proxy()->delete();
+ }
+
+ /**
+ * Magic getter to access properties
+ *
+ * @param string $name Property to access
+ * @return mixed The requested property
+ * @throws TwilioException For unknown properties
+ */
+ public function __get($name) {
+ if (array_key_exists($name, $this->properties)) {
+ return $this->properties[$name];
+ }
+
+ if (property_exists($this, '_' . $name)) {
+ $method = 'get' . ucfirst($name);
+ return $this->$method();
+ }
+
+ throw new TwilioException('Unknown property: ' . $name);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Notifications.V1.CredentialInstance ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php b/Twilio/Rest/Notifications/V1/CredentialList.php
index 801d736..9969aae 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php
+++ b/Twilio/Rest/Notifications/V1/CredentialList.php
@@ -7,33 +7,30 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Notifications\V1;
use Twilio\ListResource;
use Twilio\Values;
use Twilio\Version;
-class ParticipantList extends ListResource {
+class CredentialList extends ListResource {
/**
- * Construct the ParticipantList
+ * Construct the CredentialList
*
* @param Version $version Version that contains the resource
- * @param string $conversationSid The conversation_sid
- * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantList
+ * @return \Twilio\Rest\Notifications\V1\CredentialList
*/
- public function __construct(Version $version, $conversationSid) {
+ public function __construct(Version $version) {
parent::__construct($version);
// Path Solution
- $this->solution = array(
- 'conversationSid' => $conversationSid,
- );
+ $this->solution = array();
- $this->uri = '/Conversations/' . $conversationSid . '/Participants';
+ $this->uri = '/Credentials';
}
/**
- * Streams ParticipantInstance records from the API as a generator stream.
+ * Streams CredentialInstance records from the API as a generator stream.
* This operation lazily loads records as efficiently as possible until the
* limit
* is reached.
@@ -62,7 +59,7 @@ class ParticipantList extends ListResource {
}
/**
- * Reads ParticipantInstance records from the API as a list.
+ * Reads CredentialInstance records from the API as a list.
* Unlike stream(), this operation is eager and will load `limit` records into
* memory before returning.
*
@@ -77,20 +74,20 @@ class ParticipantList extends ListResource {
* the
* limit with the most efficient page size, i.e.
* min(limit, 1000)
- * @return ParticipantInstance[] Array of results
+ * @return CredentialInstance[] Array of results
*/
public function read($limit = null, $pageSize = Values::NONE) {
return iterator_to_array($this->stream($limit, $pageSize));
}
/**
- * Retrieve a single page of ParticipantInstance records from the API.
+ * Retrieve a single page of CredentialInstance records from the API.
* Request is executed immediately
*
* @param mixed $pageSize Number of records to return, defaults to 50
* @param string $pageToken PageToken provided by the API
* @param mixed $pageNumber Page Number, this value is simply for client state
- * @return \Twilio\Page Page of ParticipantInstance
+ * @return \Twilio\Page Page of CredentialInstance
*/
public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) {
$params = Values::of(array(
@@ -105,20 +102,27 @@ class ParticipantList extends ListResource {
$params
);
- return new ParticipantPage($this->version, $response, $this->solution);
+ return new CredentialPage($this->version, $response, $this->solution);
}
/**
- * Create a new ParticipantInstance
+ * Create a new CredentialInstance
*
- * @param string $to The to
- * @param string $from The from
- * @return ParticipantInstance Newly created ParticipantInstance
+ * @param string $friendlyName The friendly_name
+ * @param string $type The type
+ * @param array $options Optional Arguments
+ * @return CredentialInstance Newly created CredentialInstance
*/
- public function create($to, $from) {
+ public function create($friendlyName, $type, array $options = array()) {
+ $options = new Values($options);
+
$data = Values::of(array(
- 'To' => $to,
- 'From' => $from,
+ 'FriendlyName' => $friendlyName,
+ 'Type' => $type,
+ 'Certificate' => $options['certificate'],
+ 'PrivateKey' => $options['privateKey'],
+ 'Sandbox' => $options['sandbox'],
+ 'ApiKey' => $options['apiKey'],
));
$payload = $this->version->create(
@@ -128,23 +132,21 @@ class ParticipantList extends ListResource {
$data
);
- return new ParticipantInstance(
+ return new CredentialInstance(
$this->version,
- $payload,
- $this->solution['conversationSid']
+ $payload
);
}
/**
- * Constructs a ParticipantContext
+ * Constructs a CredentialContext
*
* @param string $sid The sid
- * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext
+ * @return \Twilio\Rest\Notifications\V1\CredentialContext
*/
public function getContext($sid) {
- return new ParticipantContext(
+ return new CredentialContext(
$this->version,
- $this->solution['conversationSid'],
$sid
);
}
@@ -155,6 +157,6 @@ class ParticipantList extends ListResource {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.ParticipantList]';
+ return '[Twilio.Notifications.V1.CredentialList]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/ConversationPage.php b/Twilio/Rest/Notifications/V1/CredentialPage.php
index c532f09..89c55df 100644
--- a/Twilio/Rest/Conversations/V1/ConversationPage.php
+++ b/Twilio/Rest/Notifications/V1/CredentialPage.php
@@ -7,11 +7,11 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1;
+namespace Twilio\Rest\Notifications\V1;
use Twilio\Page;
-class ConversationPage extends Page {
+class CredentialPage extends Page {
public function __construct($version, $response, $solution) {
parent::__construct($version, $response);
@@ -20,7 +20,7 @@ class ConversationPage extends Page {
}
public function buildInstance(array $payload) {
- return new ConversationInstance(
+ return new CredentialInstance(
$this->version,
$payload
);
@@ -32,6 +32,6 @@ class ConversationPage extends Page {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.ConversationPage]';
+ return '[Twilio.Notifications.V1.CredentialPage]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Notifications/V1/Service/NotificationInstance.php b/Twilio/Rest/Notifications/V1/Service/NotificationInstance.php
index fae5586..4e1998f 100644
--- a/Twilio/Rest/Notifications/V1/Service/NotificationInstance.php
+++ b/Twilio/Rest/Notifications/V1/Service/NotificationInstance.php
@@ -30,6 +30,8 @@ use Twilio\Version;
* @property string data
* @property string apn
* @property string gcm
+ * @property string sms
+ * @property string facebookMessenger
*/
class NotificationInstance extends InstanceResource {
/**
@@ -60,6 +62,8 @@ class NotificationInstance extends InstanceResource {
'data' => $payload['data'],
'apn' => $payload['apn'],
'gcm' => $payload['gcm'],
+ 'sms' => $payload['sms'],
+ 'facebookMessenger' => $payload['facebook_messenger'],
);
$this->solution = array(
diff --git a/Twilio/Rest/Notifications/V1/Service/NotificationList.php b/Twilio/Rest/Notifications/V1/Service/NotificationList.php
index a2ee96b..9e3e963 100644
--- a/Twilio/Rest/Notifications/V1/Service/NotificationList.php
+++ b/Twilio/Rest/Notifications/V1/Service/NotificationList.php
@@ -53,6 +53,8 @@ class NotificationList extends ListResource {
'Data' => $options['data'],
'Apn' => $options['apn'],
'Gcm' => $options['gcm'],
+ 'Sms' => $options['sms'],
+ 'FacebookMessenger' => $options['facebookMessenger'],
));
$payload = $this->version->create(
diff --git a/Twilio/Rest/Notifications/V1/ServiceContext.php b/Twilio/Rest/Notifications/V1/ServiceContext.php
index 501de37..b290eda 100644
--- a/Twilio/Rest/Notifications/V1/ServiceContext.php
+++ b/Twilio/Rest/Notifications/V1/ServiceContext.php
@@ -86,6 +86,8 @@ class ServiceContext extends InstanceContext {
'FriendlyName' => $options['friendlyName'],
'ApnCredentialSid' => $options['apnCredentialSid'],
'GcmCredentialSid' => $options['gcmCredentialSid'],
+ 'MessagingServiceSid' => $options['messagingServiceSid'],
+ 'FacebookMessengerPageId' => $options['facebookMessengerPageId'],
'DefaultApnNotificationProtocolVersion' => $options['defaultApnNotificationProtocolVersion'],
'DefaultGcmNotificationProtocolVersion' => $options['defaultGcmNotificationProtocolVersion'],
));
diff --git a/Twilio/Rest/Notifications/V1/ServiceInstance.php b/Twilio/Rest/Notifications/V1/ServiceInstance.php
index b849fbd..31ce67b 100644
--- a/Twilio/Rest/Notifications/V1/ServiceInstance.php
+++ b/Twilio/Rest/Notifications/V1/ServiceInstance.php
@@ -22,6 +22,8 @@ use Twilio\Version;
* @property \DateTime dateUpdated
* @property string apnCredentialSid
* @property string gcmCredentialSid
+ * @property string messagingServiceSid
+ * @property string facebookMessengerPageId
* @property string defaultApnNotificationProtocolVersion
* @property string defaultGcmNotificationProtocolVersion
* @property string url
@@ -51,6 +53,8 @@ class ServiceInstance extends InstanceResource {
'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
'apnCredentialSid' => $payload['apn_credential_sid'],
'gcmCredentialSid' => $payload['gcm_credential_sid'],
+ 'messagingServiceSid' => $payload['messaging_service_sid'],
+ 'facebookMessengerPageId' => $payload['facebook_messenger_page_id'],
'defaultApnNotificationProtocolVersion' => $payload['default_apn_notification_protocol_version'],
'defaultGcmNotificationProtocolVersion' => $payload['default_gcm_notification_protocol_version'],
'url' => $payload['url'],
diff --git a/Twilio/Rest/Notifications/V1/ServiceList.php b/Twilio/Rest/Notifications/V1/ServiceList.php
index ef62cfa..60ab7bf 100644
--- a/Twilio/Rest/Notifications/V1/ServiceList.php
+++ b/Twilio/Rest/Notifications/V1/ServiceList.php
@@ -42,6 +42,8 @@ class ServiceList extends ListResource {
'FriendlyName' => $options['friendlyName'],
'ApnCredentialSid' => $options['apnCredentialSid'],
'GcmCredentialSid' => $options['gcmCredentialSid'],
+ 'MessagingServiceSid' => $options['messagingServiceSid'],
+ 'FacebookMessengerPageId' => $options['facebookMessengerPageId'],
'DefaultApnNotificationProtocolVersion' => $options['defaultApnNotificationProtocolVersion'],
'DefaultGcmNotificationProtocolVersion' => $options['defaultGcmNotificationProtocolVersion'],
));
diff --git a/Twilio/Rest/Conversations.php b/Twilio/Rest/Preview.php
index d287f66..b63b27a 100644
--- a/Twilio/Rest/Conversations.php
+++ b/Twilio/Rest/Preview.php
@@ -11,35 +11,35 @@ namespace Twilio\Rest;
use Twilio\Domain;
use Twilio\Exceptions\TwilioException;
-use Twilio\Rest\Conversations\V1;
+use Twilio\Rest\Preview\Wireless;
/**
- * @property \Twilio\Rest\Conversations\V1 v1
+ * @property \Twilio\Rest\Preview\Wireless wireless
*/
-class Conversations extends Domain {
- protected $_v1 = null;
+class Preview extends Domain {
+ protected $_wireless = null;
/**
- * Construct the Conversations Domain
+ * Construct the Preview Domain
*
* @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with
* Twilio
- * @return \Twilio\Rest\Conversations Domain for Conversations
+ * @return \Twilio\Rest\Preview Domain for Preview
*/
public function __construct(Client $client) {
parent::__construct($client);
- $this->baseUrl = 'https://conversations.twilio.com';
+ $this->baseUrl = 'https://preview.twilio.com';
}
/**
- * @return \Twilio\Rest\Conversations\V1 Version v1 of conversations
+ * @return \Twilio\Rest\Preview\Wireless Version wireless of preview
*/
- protected function getV1() {
- if (!$this->_v1) {
- $this->_v1 = new V1($this);
+ protected function getWireless() {
+ if (!$this->_wireless) {
+ $this->_wireless = new Wireless($this);
}
- return $this->_v1;
+ return $this->_wireless;
}
/**
@@ -76,10 +76,24 @@ class Conversations extends Domain {
}
/**
- * @return \Twilio\Rest\Conversations\V1\ConversationList
+ * @return \Twilio\Rest\Preview\Wireless\CommandList
*/
- public function conversations() {
- return $this->v1->conversations;
+ public function commands() {
+ return $this->wireless->commands;
+ }
+
+ /**
+ * @return \Twilio\Rest\Preview\Wireless\DeviceList
+ */
+ public function devices() {
+ return $this->wireless->devices;
+ }
+
+ /**
+ * @return \Twilio\Rest\Preview\Wireless\RatePlanList
+ */
+ public function ratePlans() {
+ return $this->wireless->ratePlans;
}
/**
@@ -88,6 +102,6 @@ class Conversations extends Domain {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations]';
+ return '[Twilio.Preview]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1.php b/Twilio/Rest/Preview/Wireless.php
index 5f2ec23..096de6c 100644
--- a/Twilio/Rest/Conversations/V1.php
+++ b/Twilio/Rest/Preview/Wireless.php
@@ -7,39 +7,67 @@
* / /
*/
-namespace Twilio\Rest\Conversations;
+namespace Twilio\Rest\Preview;
use Twilio\Domain;
use Twilio\Exceptions\TwilioException;
-use Twilio\Rest\Conversations\V1\ConversationList;
+use Twilio\Rest\Preview\Wireless\CommandList;
+use Twilio\Rest\Preview\Wireless\DeviceList;
+use Twilio\Rest\Preview\Wireless\RatePlanList;
use Twilio\Version;
/**
- * @property \Twilio\Rest\Conversations\V1\ConversationList conversations
- * @method \Twilio\Rest\Conversations\V1\ConversationContext conversations(string $sid)
+ * @property \Twilio\Rest\Preview\Wireless\CommandList commands
+ * @property \Twilio\Rest\Preview\Wireless\DeviceList devices
+ * @property \Twilio\Rest\Preview\Wireless\RatePlanList ratePlans
+ * @method \Twilio\Rest\Preview\Wireless\CommandContext commands(string $sid)
+ * @method \Twilio\Rest\Preview\Wireless\DeviceContext devices(string $sid)
+ * @method \Twilio\Rest\Preview\Wireless\RatePlanContext ratePlans(string $sid)
*/
-class V1 extends Version {
- protected $_conversations = null;
+class Wireless extends Version {
+ protected $_commands = null;
+ protected $_devices = null;
+ protected $_ratePlans = null;
/**
- * Construct the V1 version of Conversations
+ * Construct the Wireless version of Preview
*
* @param \Twilio\Domain $domain Domain that contains the version
- * @return \Twilio\Rest\Conversations\V1 V1 version of Conversations
+ * @return \Twilio\Rest\Preview\Wireless Wireless version of Preview
*/
public function __construct(Domain $domain) {
parent::__construct($domain);
- $this->version = 'v1';
+ $this->version = 'wireless';
}
/**
- * @return \Twilio\Rest\Conversations\V1\ConversationList
+ * @return \Twilio\Rest\Preview\Wireless\CommandList
*/
- protected function getConversations() {
- if (!$this->_conversations) {
- $this->_conversations = new ConversationList($this);
+ protected function getCommands() {
+ if (!$this->_commands) {
+ $this->_commands = new CommandList($this);
}
- return $this->_conversations;
+ return $this->_commands;
+ }
+
+ /**
+ * @return \Twilio\Rest\Preview\Wireless\DeviceList
+ */
+ protected function getDevices() {
+ if (!$this->_devices) {
+ $this->_devices = new DeviceList($this);
+ }
+ return $this->_devices;
+ }
+
+ /**
+ * @return \Twilio\Rest\Preview\Wireless\RatePlanList
+ */
+ protected function getRatePlans() {
+ if (!$this->_ratePlans) {
+ $this->_ratePlans = new RatePlanList($this);
+ }
+ return $this->_ratePlans;
}
/**
@@ -81,6 +109,6 @@ class V1 extends Version {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1]';
+ return '[Twilio.Preview.Wireless]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php b/Twilio/Rest/Preview/Wireless/CommandContext.php
index 79335b8..4ff3b26 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php
+++ b/Twilio/Rest/Preview/Wireless/CommandContext.php
@@ -7,37 +7,35 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Preview\Wireless;
use Twilio\InstanceContext;
use Twilio\Values;
use Twilio\Version;
-class ParticipantContext extends InstanceContext {
+class CommandContext extends InstanceContext {
/**
- * Initialize the ParticipantContext
+ * Initialize the CommandContext
*
* @param \Twilio\Version $version Version that contains the resource
- * @param string $conversationSid The conversation_sid
* @param string $sid The sid
- * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext
+ * @return \Twilio\Rest\Preview\Wireless\CommandContext
*/
- public function __construct(Version $version, $conversationSid, $sid) {
+ public function __construct(Version $version, $sid) {
parent::__construct($version);
// Path Solution
$this->solution = array(
- 'conversationSid' => $conversationSid,
'sid' => $sid,
);
- $this->uri = '/Conversations/' . $conversationSid . '/Participants/' . $sid . '';
+ $this->uri = '/Commands/' . $sid . '';
}
/**
- * Fetch a ParticipantInstance
+ * Fetch a CommandInstance
*
- * @return ParticipantInstance Fetched ParticipantInstance
+ * @return CommandInstance Fetched CommandInstance
*/
public function fetch() {
$params = Values::of(array());
@@ -48,10 +46,9 @@ class ParticipantContext extends InstanceContext {
$params
);
- return new ParticipantInstance(
+ return new CommandInstance(
$this->version,
$payload,
- $this->solution['conversationSid'],
$this->solution['sid']
);
}
@@ -66,6 +63,6 @@ class ParticipantContext extends InstanceContext {
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
- return '[Twilio.Conversations.V1.ParticipantContext ' . implode(' ', $context) . ']';
+ return '[Twilio.Preview.Wireless.CommandContext ' . implode(' ', $context) . ']';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/ConversationInstance.php b/Twilio/Rest/Preview/Wireless/CommandInstance.php
index 805b27d..597347a 100644
--- a/Twilio/Rest/Conversations/V1/ConversationInstance.php
+++ b/Twilio/Rest/Preview/Wireless/CommandInstance.php
@@ -7,7 +7,7 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1;
+namespace Twilio\Rest\Preview\Wireless;
use Twilio\Deserialize;
use Twilio\Exceptions\TwilioException;
@@ -16,24 +16,23 @@ use Twilio\Version;
/**
* @property string sid
+ * @property string accountSid
+ * @property string deviceSid
+ * @property string command
* @property string status
- * @property string duration
+ * @property string direction
* @property \DateTime dateCreated
- * @property \DateTime startTime
- * @property \DateTime endTime
- * @property string accountSid
+ * @property \DateTime dateUpdated
* @property string url
*/
-class ConversationInstance extends InstanceResource {
- protected $_participants = null;
-
+class CommandInstance extends InstanceResource {
/**
- * Initialize the ConversationInstance
+ * Initialize the CommandInstance
*
* @param \Twilio\Version $version Version that contains the resource
* @param mixed[] $payload The response payload
* @param string $sid The sid
- * @return \Twilio\Rest\Conversations\V1\ConversationInstance
+ * @return \Twilio\Rest\Preview\Wireless\CommandInstance
*/
public function __construct(Version $version, array $payload, $sid = null) {
parent::__construct($version);
@@ -41,12 +40,13 @@ class ConversationInstance extends InstanceResource {
// Marshaled Properties
$this->properties = array(
'sid' => $payload['sid'],
+ 'accountSid' => $payload['account_sid'],
+ 'deviceSid' => $payload['device_sid'],
+ 'command' => $payload['command'],
'status' => $payload['status'],
- 'duration' => $payload['duration'],
+ 'direction' => $payload['direction'],
'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
- 'startTime' => Deserialize::iso8601DateTime($payload['start_time']),
- 'endTime' => Deserialize::iso8601DateTime($payload['end_time']),
- 'accountSid' => $payload['account_sid'],
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
'url' => $payload['url'],
);
@@ -59,12 +59,12 @@ class ConversationInstance extends InstanceResource {
* Generate an instance context for the instance, the context is capable of
* performing various actions. All instance actions are proxied to the context
*
- * @return \Twilio\Rest\Conversations\V1\ConversationContext Context for this
- * ConversationInstance
+ * @return \Twilio\Rest\Preview\Wireless\CommandContext Context for this
+ * CommandInstance
*/
protected function proxy() {
if (!$this->context) {
- $this->context = new ConversationContext(
+ $this->context = new CommandContext(
$this->version,
$this->solution['sid']
);
@@ -74,24 +74,15 @@ class ConversationInstance extends InstanceResource {
}
/**
- * Fetch a ConversationInstance
+ * Fetch a CommandInstance
*
- * @return ConversationInstance Fetched ConversationInstance
+ * @return CommandInstance Fetched CommandInstance
*/
public function fetch() {
return $this->proxy()->fetch();
}
/**
- * Access the participants
- *
- * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantList
- */
- protected function getParticipants() {
- return $this->proxy()->participants;
- }
-
- /**
* Magic getter to access properties
*
* @param string $name Property to access
@@ -121,6 +112,6 @@ class ConversationInstance extends InstanceResource {
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
- return '[Twilio.Conversations.V1.ConversationInstance ' . implode(' ', $context) . ']';
+ return '[Twilio.Preview.Wireless.CommandInstance ' . implode(' ', $context) . ']';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/CommandList.php b/Twilio/Rest/Preview/Wireless/CommandList.php
new file mode 100644
index 0000000..6798acd
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/CommandList.php
@@ -0,0 +1,171 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless;
+
+use Twilio\ListResource;
+use Twilio\Values;
+use Twilio\Version;
+
+class CommandList extends ListResource {
+ /**
+ * Construct the CommandList
+ *
+ * @param Version $version Version that contains the resource
+ * @return \Twilio\Rest\Preview\Wireless\CommandList
+ */
+ public function __construct(Version $version) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array();
+
+ $this->uri = '/Commands';
+ }
+
+ /**
+ * Streams CommandInstance records from the API as a generator stream.
+ * This operation lazily loads records as efficiently as possible until the
+ * limit
+ * is reached.
+ * The results are returned as a generator, so this operation is memory
+ * efficient.
+ *
+ * @param array $options Optional Arguments
+ * @param int $limit Upper limit for the number of records to return. stream()
+ * guarantees to never return more than limit. Default is no
+ * limit
+ * @param mixed $pageSize Number of records to fetch per request, when not set
+ * will use
+ * the default value of 50 records. If no page_size is
+ * defined
+ * but a limit is defined, stream() will attempt to read
+ * the limit
+ * with the most efficient page size, i.e. min(limit,
+ * 1000)
+ * @return \Twilio\Stream stream of results
+ */
+ public function stream(array $options = array(), $limit = null, $pageSize = null) {
+ $limits = $this->version->readLimits($limit, $pageSize);
+
+ $page = $this->page(
+ $options,
+ $limits['pageSize']);
+
+ return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
+ }
+
+ /**
+ * Reads CommandInstance records from the API as a list.
+ * Unlike stream(), this operation is eager and will load `limit` records into
+ * memory before returning.
+ *
+ * @param array $options Optional Arguments
+ * @param int $limit Upper limit for the number of records to return. read()
+ * guarantees to never return more than limit. Default is no
+ * limit
+ * @param mixed $pageSize Number of records to fetch per request, when not set
+ * will use
+ * the default value of 50 records. If no page_size is
+ * defined
+ * but a limit is defined, read() will attempt to read
+ * the
+ * limit with the most efficient page size, i.e.
+ * min(limit, 1000)
+ * @return CommandInstance[] Array of results
+ */
+ public function read(array $options = array(), $limit = null, $pageSize = Values::NONE) {
+ return iterator_to_array($this->stream(
+ $options,
+ $limit, $pageSize));
+ }
+
+ /**
+ * Retrieve a single page of CommandInstance records from the API.
+ * Request is executed immediately
+ *
+ * @param array $options Optional Arguments
+ * @param mixed $pageSize Number of records to return, defaults to 50
+ * @param string $pageToken PageToken provided by the API
+ * @param mixed $pageNumber Page Number, this value is simply for client state
+ * @return \Twilio\Page Page of CommandInstance
+ */
+ public function page(array $options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) {
+ $options = new Values($options);
+ $params = Values::of(array(
+ 'Device' => $options['device'],
+ 'Status' => $options['status'],
+ 'Direction' => $options['direction'],
+ 'PageToken' => $pageToken,
+ 'Page' => $pageNumber,
+ 'PageSize' => $pageSize,
+ ));
+
+ $response = $this->version->page(
+ 'GET',
+ $this->uri,
+ $params
+ );
+
+ return new CommandPage($this->version, $response, $this->solution);
+ }
+
+ /**
+ * Create a new CommandInstance
+ *
+ * @param string $device The device
+ * @param string $command The command
+ * @param array $options Optional Arguments
+ * @return CommandInstance Newly created CommandInstance
+ */
+ public function create($device, $command, array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'Device' => $device,
+ 'Command' => $command,
+ 'CallbackMethod' => $options['callbackMethod'],
+ 'CallbackUrl' => $options['callbackUrl'],
+ ));
+
+ $payload = $this->version->create(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new CommandInstance(
+ $this->version,
+ $payload
+ );
+ }
+
+ /**
+ * Constructs a CommandContext
+ *
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Preview\Wireless\CommandContext
+ */
+ public function getContext($sid) {
+ return new CommandContext(
+ $this->version,
+ $sid
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Preview.Wireless.CommandList]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/CompletedPage.php b/Twilio/Rest/Preview/Wireless/CommandPage.php
index 3de38f0..b7e8b3d 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/CompletedPage.php
+++ b/Twilio/Rest/Preview/Wireless/CommandPage.php
@@ -7,11 +7,11 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Preview\Wireless;
use Twilio\Page;
-class CompletedPage extends Page {
+class CommandPage extends Page {
public function __construct($version, $response, $solution) {
parent::__construct($version, $response);
@@ -20,7 +20,7 @@ class CompletedPage extends Page {
}
public function buildInstance(array $payload) {
- return new CompletedInstance(
+ return new CommandInstance(
$this->version,
$payload
);
@@ -32,6 +32,6 @@ class CompletedPage extends Page {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.CompletedPage]';
+ return '[Twilio.Preview.Wireless.CommandPage]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/Device/UsageContext.php b/Twilio/Rest/Preview/Wireless/Device/UsageContext.php
new file mode 100644
index 0000000..14928f1
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/Device/UsageContext.php
@@ -0,0 +1,74 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless\Device;
+
+use Twilio\InstanceContext;
+use Twilio\Values;
+use Twilio\Version;
+
+class UsageContext extends InstanceContext {
+ /**
+ * Initialize the UsageContext
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param string $deviceSid The device_sid
+ * @return \Twilio\Rest\Preview\Wireless\Device\UsageContext
+ */
+ public function __construct(Version $version, $deviceSid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'deviceSid' => $deviceSid,
+ );
+
+ $this->uri = '/Devices/' . $deviceSid . '/Usage';
+ }
+
+ /**
+ * Fetch a UsageInstance
+ *
+ * @param array $options Optional Arguments
+ * @return UsageInstance Fetched UsageInstance
+ */
+ public function fetch(array $options = array()) {
+ $options = new Values($options);
+
+ $params = Values::of(array(
+ 'End' => $options['end'],
+ 'Start' => $options['start'],
+ ));
+
+ $payload = $this->version->fetch(
+ 'GET',
+ $this->uri,
+ $params
+ );
+
+ return new UsageInstance(
+ $this->version,
+ $payload,
+ $this->solution['deviceSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Preview.Wireless.UsageContext ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/Device/UsageInstance.php b/Twilio/Rest/Preview/Wireless/Device/UsageInstance.php
new file mode 100644
index 0000000..25ebf1f
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/Device/UsageInstance.php
@@ -0,0 +1,119 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless\Device;
+
+use Twilio\Exceptions\TwilioException;
+use Twilio\InstanceResource;
+use Twilio\Version;
+
+/**
+ * @property string deviceSid
+ * @property string deviceAlias
+ * @property string accountSid
+ * @property string period
+ * @property string commandsUsage
+ * @property string commandsCosts
+ * @property string dataUsage
+ * @property string dataCosts
+ * @property string url
+ */
+class UsageInstance extends InstanceResource {
+ /**
+ * Initialize the UsageInstance
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param mixed[] $payload The response payload
+ * @param string $deviceSid The device_sid
+ * @return \Twilio\Rest\Preview\Wireless\Device\UsageInstance
+ */
+ public function __construct(Version $version, array $payload, $deviceSid) {
+ parent::__construct($version);
+
+ // Marshaled Properties
+ $this->properties = array(
+ 'deviceSid' => $payload['device_sid'],
+ 'deviceAlias' => $payload['device_alias'],
+ 'accountSid' => $payload['account_sid'],
+ 'period' => $payload['period'],
+ 'commandsUsage' => $payload['commands_usage'],
+ 'commandsCosts' => $payload['commands_costs'],
+ 'dataUsage' => $payload['data_usage'],
+ 'dataCosts' => $payload['data_costs'],
+ 'url' => $payload['url'],
+ );
+
+ $this->solution = array(
+ 'deviceSid' => $deviceSid,
+ );
+ }
+
+ /**
+ * Generate an instance context for the instance, the context is capable of
+ * performing various actions. All instance actions are proxied to the context
+ *
+ * @return \Twilio\Rest\Preview\Wireless\Device\UsageContext Context for this
+ * UsageInstance
+ */
+ protected function proxy() {
+ if (!$this->context) {
+ $this->context = new UsageContext(
+ $this->version,
+ $this->solution['deviceSid']
+ );
+ }
+
+ return $this->context;
+ }
+
+ /**
+ * Fetch a UsageInstance
+ *
+ * @param array $options Optional Arguments
+ * @return UsageInstance Fetched UsageInstance
+ */
+ public function fetch(array $options = array()) {
+ return $this->proxy()->fetch(
+ $options
+ );
+ }
+
+ /**
+ * Magic getter to access properties
+ *
+ * @param string $name Property to access
+ * @return mixed The requested property
+ * @throws TwilioException For unknown properties
+ */
+ public function __get($name) {
+ if (array_key_exists($name, $this->properties)) {
+ return $this->properties[$name];
+ }
+
+ if (property_exists($this, '_' . $name)) {
+ $method = 'get' . ucfirst($name);
+ return $this->$method();
+ }
+
+ throw new TwilioException('Unknown property: ' . $name);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Preview.Wireless.UsageInstance ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/Device/UsageList.php b/Twilio/Rest/Preview/Wireless/Device/UsageList.php
new file mode 100644
index 0000000..59d25e6
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/Device/UsageList.php
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless\Device;
+
+use Twilio\ListResource;
+use Twilio\Version;
+
+class UsageList extends ListResource {
+ /**
+ * Construct the UsageList
+ *
+ * @param Version $version Version that contains the resource
+ * @param string $deviceSid The device_sid
+ * @return \Twilio\Rest\Preview\Wireless\Device\UsageList
+ */
+ public function __construct(Version $version, $deviceSid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'deviceSid' => $deviceSid,
+ );
+ }
+
+ /**
+ * Constructs a UsageContext
+ *
+ * @return \Twilio\Rest\Preview\Wireless\Device\UsageContext
+ */
+ public function getContext() {
+ return new UsageContext(
+ $this->version,
+ $this->solution['deviceSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Preview.Wireless.UsageList]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/Device/UsagePage.php b/Twilio/Rest/Preview/Wireless/Device/UsagePage.php
new file mode 100644
index 0000000..d35524f
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/Device/UsagePage.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless\Device;
+
+use Twilio\Page;
+
+class UsagePage extends Page {
+ public function __construct($version, $response, $solution) {
+ parent::__construct($version, $response);
+
+ // Path Solution
+ $this->solution = $solution;
+ }
+
+ public function buildInstance(array $payload) {
+ return new UsageInstance(
+ $this->version,
+ $payload,
+ $this->solution['deviceSid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Preview.Wireless.UsagePage]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/ConversationContext.php b/Twilio/Rest/Preview/Wireless/DeviceContext.php
index 37939bb..8509d72 100644
--- a/Twilio/Rest/Conversations/V1/ConversationContext.php
+++ b/Twilio/Rest/Preview/Wireless/DeviceContext.php
@@ -7,27 +7,27 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1;
+namespace Twilio\Rest\Preview\Wireless;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceContext;
-use Twilio\Rest\Conversations\V1\Conversation\ParticipantList;
+use Twilio\Rest\Preview\Wireless\Device\UsageList;
use Twilio\Values;
use Twilio\Version;
/**
- * @property \Twilio\Rest\Conversations\V1\Conversation\ParticipantList participants
- * @method \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext participants(string $sid)
+ * @property \Twilio\Rest\Preview\Wireless\Device\UsageList usage
+ * @method \Twilio\Rest\Preview\Wireless\Device\UsageContext usage()
*/
-class ConversationContext extends InstanceContext {
- protected $_participants = null;
+class DeviceContext extends InstanceContext {
+ protected $_usage = null;
/**
- * Initialize the ConversationContext
+ * Initialize the DeviceContext
*
* @param \Twilio\Version $version Version that contains the resource
* @param string $sid The sid
- * @return \Twilio\Rest\Conversations\V1\ConversationContext
+ * @return \Twilio\Rest\Preview\Wireless\DeviceContext
*/
public function __construct(Version $version, $sid) {
parent::__construct($version);
@@ -37,13 +37,13 @@ class ConversationContext extends InstanceContext {
'sid' => $sid,
);
- $this->uri = '/Conversations/' . $sid . '';
+ $this->uri = '/Devices/' . $sid . '';
}
/**
- * Fetch a ConversationInstance
+ * Fetch a DeviceInstance
*
- * @return ConversationInstance Fetched ConversationInstance
+ * @return DeviceInstance Fetched DeviceInstance
*/
public function fetch() {
$params = Values::of(array());
@@ -54,7 +54,7 @@ class ConversationContext extends InstanceContext {
$params
);
- return new ConversationInstance(
+ return new DeviceInstance(
$this->version,
$payload,
$this->solution['sid']
@@ -62,19 +62,53 @@ class ConversationContext extends InstanceContext {
}
/**
- * Access the participants
+ * Update the DeviceInstance
*
- * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantList
+ * @param array $options Optional Arguments
+ * @return DeviceInstance Updated DeviceInstance
*/
- protected function getParticipants() {
- if (!$this->_participants) {
- $this->_participants = new ParticipantList(
+ public function update(array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'Alias' => $options['alias'],
+ 'CallbackMethod' => $options['callbackMethod'],
+ 'CallbackUrl' => $options['callbackUrl'],
+ 'FriendlyName' => $options['friendlyName'],
+ 'SimIdentifier' => $options['simIdentifier'],
+ 'Status' => $options['status'],
+ 'CommandsCallbackMethod' => $options['commandsCallbackMethod'],
+ 'CommandsCallbackUrl' => $options['commandsCallbackUrl'],
+ ));
+
+ $payload = $this->version->update(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new DeviceInstance(
+ $this->version,
+ $payload,
+ $this->solution['sid']
+ );
+ }
+
+ /**
+ * Access the usage
+ *
+ * @return \Twilio\Rest\Preview\Wireless\Device\UsageList
+ */
+ protected function getUsage() {
+ if (!$this->_usage) {
+ $this->_usage = new UsageList(
$this->version,
$this->solution['sid']
);
}
- return $this->_participants;
+ return $this->_usage;
}
/**
@@ -120,6 +154,6 @@ class ConversationContext extends InstanceContext {
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
- return '[Twilio.Conversations.V1.ConversationContext ' . implode(' ', $context) . ']';
+ return '[Twilio.Preview.Wireless.DeviceContext ' . implode(' ', $context) . ']';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/DeviceInstance.php b/Twilio/Rest/Preview/Wireless/DeviceInstance.php
new file mode 100644
index 0000000..79257c2
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/DeviceInstance.php
@@ -0,0 +1,148 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless;
+
+use Twilio\Deserialize;
+use Twilio\Exceptions\TwilioException;
+use Twilio\InstanceResource;
+use Twilio\Version;
+
+/**
+ * @property string sid
+ * @property string alias
+ * @property string accountSid
+ * @property string ratePlanSid
+ * @property string friendlyName
+ * @property string simIdentifier
+ * @property string status
+ * @property string commandsCallbackUrl
+ * @property string commandsCallbackMethod
+ * @property \DateTime dateCreated
+ * @property \DateTime dateUpdated
+ * @property string url
+ * @property string links
+ */
+class DeviceInstance extends InstanceResource {
+ protected $_usage = null;
+
+ /**
+ * Initialize the DeviceInstance
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param mixed[] $payload The response payload
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Preview\Wireless\DeviceInstance
+ */
+ public function __construct(Version $version, array $payload, $sid = null) {
+ parent::__construct($version);
+
+ // Marshaled Properties
+ $this->properties = array(
+ 'sid' => $payload['sid'],
+ 'alias' => $payload['alias'],
+ 'accountSid' => $payload['account_sid'],
+ 'ratePlanSid' => $payload['rate_plan_sid'],
+ 'friendlyName' => $payload['friendly_name'],
+ 'simIdentifier' => $payload['sim_identifier'],
+ 'status' => $payload['status'],
+ 'commandsCallbackUrl' => $payload['commands_callback_url'],
+ 'commandsCallbackMethod' => $payload['commands_callback_method'],
+ 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
+ 'url' => $payload['url'],
+ 'links' => $payload['links'],
+ );
+
+ $this->solution = array(
+ 'sid' => $sid ?: $this->properties['sid'],
+ );
+ }
+
+ /**
+ * Generate an instance context for the instance, the context is capable of
+ * performing various actions. All instance actions are proxied to the context
+ *
+ * @return \Twilio\Rest\Preview\Wireless\DeviceContext Context for this
+ * DeviceInstance
+ */
+ protected function proxy() {
+ if (!$this->context) {
+ $this->context = new DeviceContext(
+ $this->version,
+ $this->solution['sid']
+ );
+ }
+
+ return $this->context;
+ }
+
+ /**
+ * Fetch a DeviceInstance
+ *
+ * @return DeviceInstance Fetched DeviceInstance
+ */
+ public function fetch() {
+ return $this->proxy()->fetch();
+ }
+
+ /**
+ * Update the DeviceInstance
+ *
+ * @param array $options Optional Arguments
+ * @return DeviceInstance Updated DeviceInstance
+ */
+ public function update(array $options = array()) {
+ return $this->proxy()->update(
+ $options
+ );
+ }
+
+ /**
+ * Access the usage
+ *
+ * @return \Twilio\Rest\Preview\Wireless\Device\UsageList
+ */
+ protected function getUsage() {
+ return $this->proxy()->usage;
+ }
+
+ /**
+ * Magic getter to access properties
+ *
+ * @param string $name Property to access
+ * @return mixed The requested property
+ * @throws TwilioException For unknown properties
+ */
+ public function __get($name) {
+ if (array_key_exists($name, $this->properties)) {
+ return $this->properties[$name];
+ }
+
+ if (property_exists($this, '_' . $name)) {
+ $method = 'get' . ucfirst($name);
+ return $this->$method();
+ }
+
+ throw new TwilioException('Unknown property: ' . $name);
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Preview.Wireless.DeviceInstance ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/DeviceList.php b/Twilio/Rest/Preview/Wireless/DeviceList.php
new file mode 100644
index 0000000..1a3c928
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/DeviceList.php
@@ -0,0 +1,175 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless;
+
+use Twilio\ListResource;
+use Twilio\Values;
+use Twilio\Version;
+
+class DeviceList extends ListResource {
+ /**
+ * Construct the DeviceList
+ *
+ * @param Version $version Version that contains the resource
+ * @return \Twilio\Rest\Preview\Wireless\DeviceList
+ */
+ public function __construct(Version $version) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array();
+
+ $this->uri = '/Devices';
+ }
+
+ /**
+ * Streams DeviceInstance records from the API as a generator stream.
+ * This operation lazily loads records as efficiently as possible until the
+ * limit
+ * is reached.
+ * The results are returned as a generator, so this operation is memory
+ * efficient.
+ *
+ * @param array $options Optional Arguments
+ * @param int $limit Upper limit for the number of records to return. stream()
+ * guarantees to never return more than limit. Default is no
+ * limit
+ * @param mixed $pageSize Number of records to fetch per request, when not set
+ * will use
+ * the default value of 50 records. If no page_size is
+ * defined
+ * but a limit is defined, stream() will attempt to read
+ * the limit
+ * with the most efficient page size, i.e. min(limit,
+ * 1000)
+ * @return \Twilio\Stream stream of results
+ */
+ public function stream(array $options = array(), $limit = null, $pageSize = null) {
+ $limits = $this->version->readLimits($limit, $pageSize);
+
+ $page = $this->page(
+ $options,
+ $limits['pageSize']);
+
+ return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
+ }
+
+ /**
+ * Reads DeviceInstance records from the API as a list.
+ * Unlike stream(), this operation is eager and will load `limit` records into
+ * memory before returning.
+ *
+ * @param array $options Optional Arguments
+ * @param int $limit Upper limit for the number of records to return. read()
+ * guarantees to never return more than limit. Default is no
+ * limit
+ * @param mixed $pageSize Number of records to fetch per request, when not set
+ * will use
+ * the default value of 50 records. If no page_size is
+ * defined
+ * but a limit is defined, read() will attempt to read
+ * the
+ * limit with the most efficient page size, i.e.
+ * min(limit, 1000)
+ * @return DeviceInstance[] Array of results
+ */
+ public function read(array $options = array(), $limit = null, $pageSize = Values::NONE) {
+ return iterator_to_array($this->stream(
+ $options,
+ $limit, $pageSize));
+ }
+
+ /**
+ * Retrieve a single page of DeviceInstance records from the API.
+ * Request is executed immediately
+ *
+ * @param array $options Optional Arguments
+ * @param mixed $pageSize Number of records to return, defaults to 50
+ * @param string $pageToken PageToken provided by the API
+ * @param mixed $pageNumber Page Number, this value is simply for client state
+ * @return \Twilio\Page Page of DeviceInstance
+ */
+ public function page(array $options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) {
+ $options = new Values($options);
+ $params = Values::of(array(
+ 'Status' => $options['status'],
+ 'SimIdentifier' => $options['simIdentifier'],
+ 'RatePlan' => $options['ratePlan'],
+ 'PageToken' => $pageToken,
+ 'Page' => $pageNumber,
+ 'PageSize' => $pageSize,
+ ));
+
+ $response = $this->version->page(
+ 'GET',
+ $this->uri,
+ $params
+ );
+
+ return new DevicePage($this->version, $response, $this->solution);
+ }
+
+ /**
+ * Create a new DeviceInstance
+ *
+ * @param string $ratePlan The rate_plan
+ * @param array $options Optional Arguments
+ * @return DeviceInstance Newly created DeviceInstance
+ */
+ public function create($ratePlan, array $options = array()) {
+ $options = new Values($options);
+
+ $data = Values::of(array(
+ 'RatePlan' => $ratePlan,
+ 'Alias' => $options['alias'],
+ 'CallbackMethod' => $options['callbackMethod'],
+ 'CallbackUrl' => $options['callbackUrl'],
+ 'FriendlyName' => $options['friendlyName'],
+ 'SimIdentifier' => $options['simIdentifier'],
+ 'Status' => $options['status'],
+ 'CommandsCallbackMethod' => $options['commandsCallbackMethod'],
+ 'CommandsCallbackUrl' => $options['commandsCallbackUrl'],
+ ));
+
+ $payload = $this->version->create(
+ 'POST',
+ $this->uri,
+ array(),
+ $data
+ );
+
+ return new DeviceInstance(
+ $this->version,
+ $payload
+ );
+ }
+
+ /**
+ * Constructs a DeviceContext
+ *
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Preview\Wireless\DeviceContext
+ */
+ public function getContext($sid) {
+ return new DeviceContext(
+ $this->version,
+ $sid
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Preview.Wireless.DeviceList]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/InProgressPage.php b/Twilio/Rest/Preview/Wireless/DevicePage.php
index cf6bc5d..fb04329 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/InProgressPage.php
+++ b/Twilio/Rest/Preview/Wireless/DevicePage.php
@@ -7,11 +7,11 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Preview\Wireless;
use Twilio\Page;
-class InProgressPage extends Page {
+class DevicePage extends Page {
public function __construct($version, $response, $solution) {
parent::__construct($version, $response);
@@ -20,7 +20,7 @@ class InProgressPage extends Page {
}
public function buildInstance(array $payload) {
- return new InProgressInstance(
+ return new DeviceInstance(
$this->version,
$payload
);
@@ -32,6 +32,6 @@ class InProgressPage extends Page {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.InProgressPage]';
+ return '[Twilio.Preview.Wireless.DevicePage]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/RatePlanContext.php b/Twilio/Rest/Preview/Wireless/RatePlanContext.php
new file mode 100644
index 0000000..30c6aa4
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/RatePlanContext.php
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless;
+
+use Twilio\InstanceContext;
+use Twilio\Values;
+use Twilio\Version;
+
+class RatePlanContext extends InstanceContext {
+ /**
+ * Initialize the RatePlanContext
+ *
+ * @param \Twilio\Version $version Version that contains the resource
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Preview\Wireless\RatePlanContext
+ */
+ public function __construct(Version $version, $sid) {
+ parent::__construct($version);
+
+ // Path Solution
+ $this->solution = array(
+ 'sid' => $sid,
+ );
+
+ $this->uri = '/RatePlans/' . $sid . '';
+ }
+
+ /**
+ * Fetch a RatePlanInstance
+ *
+ * @return RatePlanInstance Fetched RatePlanInstance
+ */
+ public function fetch() {
+ $params = Values::of(array());
+
+ $payload = $this->version->fetch(
+ 'GET',
+ $this->uri,
+ $params
+ );
+
+ return new RatePlanInstance(
+ $this->version,
+ $payload,
+ $this->solution['sid']
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ $context = array();
+ foreach ($this->solution as $key => $value) {
+ $context[] = "$key=$value";
+ }
+ return '[Twilio.Preview.Wireless.RatePlanContext ' . implode(' ', $context) . ']';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php b/Twilio/Rest/Preview/Wireless/RatePlanInstance.php
index 98077f7..d5212b8 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php
+++ b/Twilio/Rest/Preview/Wireless/RatePlanInstance.php
@@ -7,7 +7,7 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Preview\Wireless;
use Twilio\Deserialize;
use Twilio\Exceptions\TwilioException;
@@ -16,45 +16,53 @@ use Twilio\Version;
/**
* @property string sid
- * @property string address
- * @property string status
- * @property string conversationSid
- * @property \DateTime dateCreated
- * @property \DateTime startTime
- * @property \DateTime endTime
- * @property string duration
+ * @property string alias
* @property string accountSid
+ * @property string friendlyName
+ * @property string dataMetering
+ * @property string capabilities
+ * @property string voiceCap
+ * @property string messagingCap
+ * @property string commandsCap
+ * @property string dataCap
+ * @property string capPeriod
+ * @property string capUnit
+ * @property \DateTime dateCreated
+ * @property \DateTime dateUpdated
* @property string url
*/
-class ParticipantInstance extends InstanceResource {
+class RatePlanInstance extends InstanceResource {
/**
- * Initialize the ParticipantInstance
+ * Initialize the RatePlanInstance
*
* @param \Twilio\Version $version Version that contains the resource
* @param mixed[] $payload The response payload
- * @param string $conversationSid The conversation_sid
* @param string $sid The sid
- * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantInstance
+ * @return \Twilio\Rest\Preview\Wireless\RatePlanInstance
*/
- public function __construct(Version $version, array $payload, $conversationSid, $sid = null) {
+ public function __construct(Version $version, array $payload, $sid = null) {
parent::__construct($version);
// Marshaled Properties
$this->properties = array(
'sid' => $payload['sid'],
- 'address' => $payload['address'],
- 'status' => $payload['status'],
- 'conversationSid' => $payload['conversation_sid'],
- 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
- 'startTime' => Deserialize::iso8601DateTime($payload['start_time']),
- 'endTime' => Deserialize::iso8601DateTime($payload['end_time']),
- 'duration' => $payload['duration'],
+ 'alias' => $payload['alias'],
'accountSid' => $payload['account_sid'],
+ 'friendlyName' => $payload['friendly_name'],
+ 'dataMetering' => $payload['data_metering'],
+ 'capabilities' => $payload['capabilities'],
+ 'voiceCap' => $payload['voice_cap'],
+ 'messagingCap' => $payload['messaging_cap'],
+ 'commandsCap' => $payload['commands_cap'],
+ 'dataCap' => $payload['data_cap'],
+ 'capPeriod' => $payload['cap_period'],
+ 'capUnit' => $payload['cap_unit'],
+ 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']),
+ 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']),
'url' => $payload['url'],
);
$this->solution = array(
- 'conversationSid' => $conversationSid,
'sid' => $sid ?: $this->properties['sid'],
);
}
@@ -63,13 +71,13 @@ class ParticipantInstance extends InstanceResource {
* Generate an instance context for the instance, the context is capable of
* performing various actions. All instance actions are proxied to the context
*
- * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext Context for this ParticipantInstance
+ * @return \Twilio\Rest\Preview\Wireless\RatePlanContext Context for this
+ * RatePlanInstance
*/
protected function proxy() {
if (!$this->context) {
- $this->context = new ParticipantContext(
+ $this->context = new RatePlanContext(
$this->version,
- $this->solution['conversationSid'],
$this->solution['sid']
);
}
@@ -78,9 +86,9 @@ class ParticipantInstance extends InstanceResource {
}
/**
- * Fetch a ParticipantInstance
+ * Fetch a RatePlanInstance
*
- * @return ParticipantInstance Fetched ParticipantInstance
+ * @return RatePlanInstance Fetched RatePlanInstance
*/
public function fetch() {
return $this->proxy()->fetch();
@@ -116,6 +124,6 @@ class ParticipantInstance extends InstanceResource {
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
- return '[Twilio.Conversations.V1.ParticipantInstance ' . implode(' ', $context) . ']';
+ return '[Twilio.Preview.Wireless.RatePlanInstance ' . implode(' ', $context) . ']';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Conversations/V1/Conversation/InProgressList.php b/Twilio/Rest/Preview/Wireless/RatePlanList.php
index caa307a..2df359b 100644
--- a/Twilio/Rest/Conversations/V1/Conversation/InProgressList.php
+++ b/Twilio/Rest/Preview/Wireless/RatePlanList.php
@@ -7,18 +7,18 @@
* / /
*/
-namespace Twilio\Rest\Conversations\V1\Conversation;
+namespace Twilio\Rest\Preview\Wireless;
use Twilio\ListResource;
use Twilio\Values;
use Twilio\Version;
-class InProgressList extends ListResource {
+class RatePlanList extends ListResource {
/**
- * Construct the InProgressList
+ * Construct the RatePlanList
*
* @param Version $version Version that contains the resource
- * @return \Twilio\Rest\Conversations\V1\Conversation\InProgressList
+ * @return \Twilio\Rest\Preview\Wireless\RatePlanList
*/
public function __construct(Version $version) {
parent::__construct($version);
@@ -26,11 +26,11 @@ class InProgressList extends ListResource {
// Path Solution
$this->solution = array();
- $this->uri = '/Conversations/InProgress';
+ $this->uri = '/RatePlans';
}
/**
- * Streams InProgressInstance records from the API as a generator stream.
+ * Streams RatePlanInstance records from the API as a generator stream.
* This operation lazily loads records as efficiently as possible until the
* limit
* is reached.
@@ -59,7 +59,7 @@ class InProgressList extends ListResource {
}
/**
- * Reads InProgressInstance records from the API as a list.
+ * Reads RatePlanInstance records from the API as a list.
* Unlike stream(), this operation is eager and will load `limit` records into
* memory before returning.
*
@@ -74,20 +74,20 @@ class InProgressList extends ListResource {
* the
* limit with the most efficient page size, i.e.
* min(limit, 1000)
- * @return InProgressInstance[] Array of results
+ * @return RatePlanInstance[] Array of results
*/
public function read($limit = null, $pageSize = Values::NONE) {
return iterator_to_array($this->stream($limit, $pageSize));
}
/**
- * Retrieve a single page of InProgressInstance records from the API.
+ * Retrieve a single page of RatePlanInstance records from the API.
* Request is executed immediately
*
* @param mixed $pageSize Number of records to return, defaults to 50
* @param string $pageToken PageToken provided by the API
* @param mixed $pageNumber Page Number, this value is simply for client state
- * @return \Twilio\Page Page of InProgressInstance
+ * @return \Twilio\Page Page of RatePlanInstance
*/
public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) {
$params = Values::of(array(
@@ -102,7 +102,20 @@ class InProgressList extends ListResource {
$params
);
- return new InProgressPage($this->version, $response, $this->solution);
+ return new RatePlanPage($this->version, $response, $this->solution);
+ }
+
+ /**
+ * Constructs a RatePlanContext
+ *
+ * @param string $sid The sid
+ * @return \Twilio\Rest\Preview\Wireless\RatePlanContext
+ */
+ public function getContext($sid) {
+ return new RatePlanContext(
+ $this->version,
+ $sid
+ );
}
/**
@@ -111,6 +124,6 @@ class InProgressList extends ListResource {
* @return string Machine friendly representation
*/
public function __toString() {
- return '[Twilio.Conversations.V1.InProgressList]';
+ return '[Twilio.Preview.Wireless.RatePlanList]';
}
} \ No newline at end of file
diff --git a/Twilio/Rest/Preview/Wireless/RatePlanPage.php b/Twilio/Rest/Preview/Wireless/RatePlanPage.php
new file mode 100644
index 0000000..ceb2fcc
--- /dev/null
+++ b/Twilio/Rest/Preview/Wireless/RatePlanPage.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Rest\Preview\Wireless;
+
+use Twilio\Page;
+
+class RatePlanPage extends Page {
+ public function __construct($version, $response, $solution) {
+ parent::__construct($version, $response);
+
+ // Path Solution
+ $this->solution = $solution;
+ }
+
+ public function buildInstance(array $payload) {
+ return new RatePlanInstance(
+ $this->version,
+ $payload
+ );
+ }
+
+ /**
+ * Provide a friendly representation
+ *
+ * @return string Machine friendly representation
+ */
+ public function __toString() {
+ return '[Twilio.Preview.Wireless.RatePlanPage]';
+ }
+} \ No newline at end of file
diff --git a/Twilio/Serialize.php b/Twilio/Serialize.php
index dd1a085..077ddbb 100644
--- a/Twilio/Serialize.php
+++ b/Twilio/Serialize.php
@@ -4,4 +4,30 @@ namespace Twilio;
class Serialize {
+ private static function flatten($map, $result = array(), $previous = array()) {
+ foreach ($map as $key => $value) {
+ if (is_array($value)) {
+ $result = self::flatten($value, $result, array_merge($previous, array($key)));
+ } else {
+ $result[join(".", array_merge($previous, array($key)))] = $value;
+ }
+ }
+
+ return $result;
+ }
+
+ public static function prefixedCollapsibleMap($map, $prefix) {
+ if (is_null($map) || $map == \Twilio\Values::NONE) {
+ return array();
+ }
+
+ $flattened = self::flatten($map);
+ $result = array();
+ foreach ($flattened as $key => $value) {
+ $result[$prefix . '.' . $key] = $value;
+ }
+
+ return $result;
+ }
+
} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Api/V2010/Account/KeyTest.php b/Twilio/Tests/Integration/Api/V2010/Account/KeyTest.php
new file mode 100644
index 0000000..3267b19
--- /dev/null
+++ b/Twilio/Tests/Integration/Api/V2010/Account/KeyTest.php
@@ -0,0 +1,183 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Api\V2010\Account;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class KeyTest extends HolodeckTestCase {
+ public function testFetchRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json'
+ )));
+ }
+
+ public function testFetchResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "foo",
+ "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
+
+ $this->assertNotNull($actual);
+ }
+
+ public function testUpdateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json'
+ )));
+ }
+
+ public function testUpdateResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "foo",
+ "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update();
+
+ $this->assertNotNull($actual);
+ }
+
+ public function testDeleteRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'delete',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json'
+ )));
+ }
+
+ public function testDeleteResponse() {
+ $this->holodeck->mock(new Response(
+ 204,
+ null
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete();
+
+ $this->assertTrue($actual);
+ }
+
+ public function testReadRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys->read();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json'
+ )));
+ }
+
+ public function testReadFullResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "keys": [
+ {
+ "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "foo",
+ "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
+ }
+ ],
+ "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
+ "end": 3,
+ "previous_page_uri": null,
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
+ "page_size": 50,
+ "start": 0,
+ "next_page_uri": null,
+ "page": 0
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys->read();
+
+ $this->assertTrue(count($actual) > 0);
+ }
+
+ public function testReadEmptyResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "keys": [],
+ "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
+ "end": 3,
+ "previous_page_uri": null,
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
+ "page_size": 50,
+ "start": 0,
+ "next_page_uri": null,
+ "page": 0
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->keys->read();
+
+ $this->assertNotNull($actual);
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Api/V2010/Account/Message/FeedbackTest.php b/Twilio/Tests/Integration/Api/V2010/Account/Message/FeedbackTest.php
new file mode 100644
index 0000000..42d5f7a
--- /dev/null
+++ b/Twilio/Tests/Integration/Api/V2010/Account/Message/FeedbackTest.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Api\V2010\Account\Message;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class FeedbackTest extends HolodeckTestCase {
+ public function testCreateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->feedback->create();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json'
+ )));
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php b/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php
index 0f59d96..50957b6 100644
--- a/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php
+++ b/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php
@@ -21,13 +21,12 @@ class MessageTest extends HolodeckTestCase {
try {
$this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->messages->create("+123456789", "+987654321");
+ ->messages->create("+123456789");
} catch (DeserializeException $e) {}
catch (TwilioException $e) {}
$values = array(
'To' => "+123456789",
- 'From' => "+987654321",
);
$this->assertTrue($this->holodeck->hasRequest(new Request(
@@ -69,7 +68,7 @@ class MessageTest extends HolodeckTestCase {
));
$actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->messages->create("+123456789", "+987654321");
+ ->messages->create("+123456789");
$this->assertNotNull($actual);
}
diff --git a/Twilio/Tests/Integration/Api/V2010/Account/NewKeyTest.php b/Twilio/Tests/Integration/Api/V2010/Account/NewKeyTest.php
new file mode 100644
index 0000000..308efad
--- /dev/null
+++ b/Twilio/Tests/Integration/Api/V2010/Account/NewKeyTest.php
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Api\V2010\Account;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class NewKeyTest extends HolodeckTestCase {
+ public function testCreateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->newKeys->create();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json'
+ )));
+ }
+
+ public function testCreateResponse() {
+ $this->holodeck->mock(new Response(
+ 201,
+ '
+ {
+ "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "foo",
+ "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "secret": "foobar"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->newKeys->create();
+
+ $this->assertNotNull($actual);
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Api/V2010/Account/NewSigningKeyTest.php b/Twilio/Tests/Integration/Api/V2010/Account/NewSigningKeyTest.php
new file mode 100644
index 0000000..071bf97
--- /dev/null
+++ b/Twilio/Tests/Integration/Api/V2010/Account/NewSigningKeyTest.php
@@ -0,0 +1,53 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Api\V2010\Account;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class NewSigningKeyTest extends HolodeckTestCase {
+ public function testCreateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->newSigningKeys->create();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json'
+ )));
+ }
+
+ public function testCreateResponse() {
+ $this->holodeck->mock(new Response(
+ 201,
+ '
+ {
+ "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "foo",
+ "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "secret": "foobar"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->newSigningKeys->create();
+
+ $this->assertNotNull($actual);
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Api/V2010/Account/SigningKeyTest.php b/Twilio/Tests/Integration/Api/V2010/Account/SigningKeyTest.php
new file mode 100644
index 0000000..26cc979
--- /dev/null
+++ b/Twilio/Tests/Integration/Api/V2010/Account/SigningKeyTest.php
@@ -0,0 +1,183 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Api\V2010\Account;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class SigningKeyTest extends HolodeckTestCase {
+ public function testFetchRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json'
+ )));
+ }
+
+ public function testFetchResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "foo",
+ "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
+
+ $this->assertNotNull($actual);
+ }
+
+ public function testUpdateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json'
+ )));
+ }
+
+ public function testUpdateResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "foo",
+ "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update();
+
+ $this->assertNotNull($actual);
+ }
+
+ public function testDeleteRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'delete',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json'
+ )));
+ }
+
+ public function testDeleteResponse() {
+ $this->holodeck->mock(new Response(
+ 204,
+ null
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete();
+
+ $this->assertTrue($actual);
+ }
+
+ public function testReadRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys->read();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json'
+ )));
+ }
+
+ public function testReadFullResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "signing_keys": [
+ {
+ "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "foo",
+ "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
+ "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000"
+ }
+ ],
+ "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
+ "end": 3,
+ "previous_page_uri": null,
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
+ "page_size": 50,
+ "start": 0,
+ "next_page_uri": null,
+ "page": 0
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys->read();
+
+ $this->assertTrue(count($actual) > 0);
+ }
+
+ public function testReadEmptyResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "signing_keys": [],
+ "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
+ "end": 3,
+ "previous_page_uri": null,
+ "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0",
+ "page_size": 50,
+ "start": 0,
+ "next_page_uri": null,
+ "page": 0
+ }
+ '
+ ));
+
+ $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
+ ->signingKeys->read();
+
+ $this->assertNotNull($actual);
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Conversations/V1/Conversation/CompletedTest.php b/Twilio/Tests/Integration/Conversations/V1/Conversation/CompletedTest.php
deleted file mode 100644
index 03291dd..0000000
--- a/Twilio/Tests/Integration/Conversations/V1/Conversation/CompletedTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/**
- * This code was generated by
- * \ / _ _ _| _ _
- * | (_)\/(_)(_|\/| |(/_ v1.0.0
- * / /
- */
-
-namespace Twilio\Tests\Integration\Conversations\V1\Conversation;
-
-use Twilio\Exceptions\DeserializeException;
-use Twilio\Exceptions\TwilioException;
-use Twilio\Http\Response;
-use Twilio\Tests\HolodeckTestCase;
-use Twilio\Tests\Request;
-
-class CompletedTest extends HolodeckTestCase {
- public function testReadRequest() {
- $this->holodeck->mock(new Response(500, ''));
-
- try {
- $this->twilio->conversations->v1->conversations
- ->completed->read();
- } catch (DeserializeException $e) {}
- catch (TwilioException $e) {}
-
- $this->assertTrue($this->holodeck->hasRequest(new Request(
- 'get',
- 'https://conversations.twilio.com/v1/Conversations/Completed'
- )));
- }
-
- public function testReadFullResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "conversations": [
- {
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "date_created": "2015-05-12T21:08:50Z",
- "duration": 60,
- "end_time": "2015-05-12T21:09:50Z",
- "links": {
- "participants": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants"
- },
- "sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "start_time": "2015-05-12T21:08:50Z",
- "status": "completed",
- "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- }
- ],
- "meta": {
- "first_page_url": "https://conversations.twilio.com/v1/Conversations/Completed?PageSize=50&Page=0",
- "key": "conversations",
- "next_page_url": null,
- "page": 0,
- "page_size": 50,
- "previous_page_url": null,
- "url": "https://conversations.twilio.com/v1/Conversations/Completed?PageSize=50&Page=0"
- }
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations
- ->completed->read();
-
- $this->assertTrue(count($actual) > 0);
- }
-
- public function testReadEmptyResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "conversations": [],
- "meta": {
- "first_page_url": "https://conversations.twilio.com/v1/Conversations/Completed?PageSize=50&Page=0",
- "key": "conversations",
- "next_page_url": null,
- "page": 0,
- "page_size": 50,
- "previous_page_url": null,
- "url": "https://conversations.twilio.com/v1/Conversations/Completed?PageSize=50&Page=0"
- }
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations
- ->completed->read();
-
- $this->assertNotNull($actual);
- }
-} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Conversations/V1/Conversation/InProgressTest.php b/Twilio/Tests/Integration/Conversations/V1/Conversation/InProgressTest.php
deleted file mode 100644
index 9ab0046..0000000
--- a/Twilio/Tests/Integration/Conversations/V1/Conversation/InProgressTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/**
- * This code was generated by
- * \ / _ _ _| _ _
- * | (_)\/(_)(_|\/| |(/_ v1.0.0
- * / /
- */
-
-namespace Twilio\Tests\Integration\Conversations\V1\Conversation;
-
-use Twilio\Exceptions\DeserializeException;
-use Twilio\Exceptions\TwilioException;
-use Twilio\Http\Response;
-use Twilio\Tests\HolodeckTestCase;
-use Twilio\Tests\Request;
-
-class InProgressTest extends HolodeckTestCase {
- public function testReadRequest() {
- $this->holodeck->mock(new Response(500, ''));
-
- try {
- $this->twilio->conversations->v1->conversations
- ->inProgress->read();
- } catch (DeserializeException $e) {}
- catch (TwilioException $e) {}
-
- $this->assertTrue($this->holodeck->hasRequest(new Request(
- 'get',
- 'https://conversations.twilio.com/v1/Conversations/InProgress'
- )));
- }
-
- public function testReadFullResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "conversations": [
- {
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "date_created": "2015-05-12T21:08:50Z",
- "duration": 60,
- "end_time": "2015-05-12T21:09:50Z",
- "links": {
- "participants": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants"
- },
- "sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "start_time": "2015-05-12T21:08:50Z",
- "status": "completed",
- "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- }
- ],
- "meta": {
- "first_page_url": "https://conversations.twilio.com/v1/Conversations/InProgress?PageSize=50&Page=0",
- "key": "conversations",
- "next_page_url": null,
- "page": 0,
- "page_size": 50,
- "previous_page_url": null,
- "url": "https://conversations.twilio.com/v1/Conversations/InProgress?PageSize=50&Page=0"
- }
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations
- ->inProgress->read();
-
- $this->assertTrue(count($actual) > 0);
- }
-
- public function testReadEmptyResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "conversations": [],
- "meta": {
- "first_page_url": "https://conversations.twilio.com/v1/Conversations/InProgress?PageSize=50&Page=0",
- "key": "conversations",
- "next_page_url": null,
- "page": 0,
- "page_size": 50,
- "previous_page_url": null,
- "url": "https://conversations.twilio.com/v1/Conversations/InProgress?PageSize=50&Page=0"
- }
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations
- ->inProgress->read();
-
- $this->assertNotNull($actual);
- }
-} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Conversations/V1/Conversation/ParticipantTest.php b/Twilio/Tests/Integration/Conversations/V1/Conversation/ParticipantTest.php
deleted file mode 100644
index 05438a8..0000000
--- a/Twilio/Tests/Integration/Conversations/V1/Conversation/ParticipantTest.php
+++ /dev/null
@@ -1,183 +0,0 @@
-<?php
-
-/**
- * This code was generated by
- * \ / _ _ _| _ _
- * | (_)\/(_)(_|\/| |(/_ v1.0.0
- * / /
- */
-
-namespace Twilio\Tests\Integration\Conversations\V1\Conversation;
-
-use Twilio\Exceptions\DeserializeException;
-use Twilio\Exceptions\TwilioException;
-use Twilio\Http\Response;
-use Twilio\Tests\HolodeckTestCase;
-use Twilio\Tests\Request;
-
-class ParticipantTest extends HolodeckTestCase {
- public function testReadRequest() {
- $this->holodeck->mock(new Response(500, ''));
-
- try {
- $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->participants->read();
- } catch (DeserializeException $e) {}
- catch (TwilioException $e) {}
-
- $this->assertTrue($this->holodeck->hasRequest(new Request(
- 'get',
- 'https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants'
- )));
- }
-
- public function testReadFullResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "meta": {
- "first_page_url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
- "key": "participants",
- "next_page_url": null,
- "page": 0,
- "page_size": 50,
- "previous_page_url": null,
- "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0"
- },
- "participants": [
- {
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "address": "torkel2@ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.endpoint.twilio.com",
- "conversation_sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "date_created": "2015-05-13T23:03:12Z",
- "duration": 685,
- "end_time": "2015-05-13T23:14:40Z",
- "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "start_time": "2015-05-13T23:03:15Z",
- "status": "disconnected",
- "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- }
- ]
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->participants->read();
-
- $this->assertTrue(count($actual) > 0);
- }
-
- public function testReadEmptyResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "meta": {
- "first_page_url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
- "key": "participants",
- "next_page_url": null,
- "page": 0,
- "page_size": 50,
- "previous_page_url": null,
- "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0"
- },
- "participants": []
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->participants->read();
-
- $this->assertNotNull($actual);
- }
-
- public function testCreateRequest() {
- $this->holodeck->mock(new Response(500, ''));
-
- try {
- $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->participants->create("+123456789", "+987654321");
- } catch (DeserializeException $e) {}
- catch (TwilioException $e) {}
-
- $values = array(
- 'To' => "+123456789",
- 'From' => "+987654321",
- );
-
- $this->assertTrue($this->holodeck->hasRequest(new Request(
- 'post',
- 'https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants',
- null,
- $values
- )));
- }
-
- public function testCreateResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "address": "torkel2@ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.endpoint.twilio.com",
- "conversation_sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "date_created": "2015-05-13T23:03:12Z",
- "duration": 685,
- "end_time": "2015-05-13T23:14:40Z",
- "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "start_time": "2015-05-13T23:03:15Z",
- "status": "disconnected",
- "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->participants->create("+123456789", "+987654321");
-
- $this->assertNotNull($actual);
- }
-
- public function testFetchRequest() {
- $this->holodeck->mock(new Response(500, ''));
-
- try {
- $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
- } catch (DeserializeException $e) {}
- catch (TwilioException $e) {}
-
- $this->assertTrue($this->holodeck->hasRequest(new Request(
- 'get',
- 'https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
- )));
- }
-
- public function testFetchResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "address": "torkel2@ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.endpoint.twilio.com",
- "conversation_sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "date_created": "2015-05-13T23:03:12Z",
- "duration": 685,
- "end_time": "2015-05-13T23:14:40Z",
- "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "start_time": "2015-05-13T23:03:15Z",
- "status": "disconnected",
- "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
- ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
-
- $this->assertNotNull($actual);
- }
-} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Conversations/V1/ConversationTest.php b/Twilio/Tests/Integration/Conversations/V1/ConversationTest.php
deleted file mode 100644
index 9d6dd53..0000000
--- a/Twilio/Tests/Integration/Conversations/V1/ConversationTest.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-/**
- * This code was generated by
- * \ / _ _ _| _ _
- * | (_)\/(_)(_|\/| |(/_ v1.0.0
- * / /
- */
-
-namespace Twilio\Tests\Integration\Conversations\V1;
-
-use Twilio\Exceptions\DeserializeException;
-use Twilio\Exceptions\TwilioException;
-use Twilio\Http\Response;
-use Twilio\Tests\HolodeckTestCase;
-use Twilio\Tests\Request;
-
-class ConversationTest extends HolodeckTestCase {
- public function testFetchRequest() {
- $this->holodeck->mock(new Response(500, ''));
-
- try {
- $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
- } catch (DeserializeException $e) {}
- catch (TwilioException $e) {}
-
- $this->assertTrue($this->holodeck->hasRequest(new Request(
- 'get',
- 'https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
- )));
- }
-
- public function testFetchResponse() {
- $this->holodeck->mock(new Response(
- 200,
- '
- {
- "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "date_created": "2015-05-12T21:13:15Z",
- "duration": 60,
- "end_time": "2015-05-12T21:14:15Z",
- "links": {
- "participants": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants"
- },
- "sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
- "start_time": "2015-05-12T21:13:15Z",
- "status": "created",
- "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- }
- '
- ));
-
- $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
-
- $this->assertNotNull($actual);
- }
-} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php b/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php
index 2391b68..73b4fd2 100644
--- a/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php
+++ b/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php
@@ -45,6 +45,12 @@ class PhoneNumberTest extends HolodeckTestCase {
"country_code": "US",
"national_format": "(510) 867-5309",
"phone_number": "+15108675309",
+ "add_ons": {
+ "status": "successful",
+ "message": null,
+ "code": null,
+ "results": {}
+ },
"url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number"
}
'
diff --git a/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php b/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php
new file mode 100644
index 0000000..e003f2e
--- /dev/null
+++ b/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php
@@ -0,0 +1,238 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Notifications\V1;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class CredentialTest extends HolodeckTestCase {
+ public function testReadRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->notifications->v1->credentials->read();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://notifications.twilio.com/v1/Credentials'
+ )));
+ }
+
+ public function testReadFullResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "credentials": [
+ {
+ "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "Test slow create",
+ "type": "apn",
+ "sandbox": "False",
+ "date_created": "2015-10-07T17:50:01Z",
+ "date_updated": "2015-10-07T17:50:01Z",
+ "url": "https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ }
+ ],
+ "meta": {
+ "page": 0,
+ "page_size": 1,
+ "first_page_url": "https://notifications.twilio.com/v1/Credentials?PageSize=1&Page=0",
+ "previous_page_url": null,
+ "url": "https://notifications.twilio.com/v1/Credentials?PageSize=1&Page=0",
+ "next_page_url": null,
+ "key": "credentials"
+ }
+ }
+ '
+ ));
+
+ $actual = $this->twilio->notifications->v1->credentials->read();
+
+ $this->assertTrue(count($actual) > 0);
+ }
+
+ public function testReadEmptyResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "credentials": [],
+ "meta": {
+ "page": 0,
+ "page_size": 1,
+ "first_page_url": "https://notifications.twilio.com/v1/Credentials?PageSize=1&Page=0",
+ "previous_page_url": null,
+ "url": "https://notifications.twilio.com/v1/Credentials?PageSize=1&Page=0",
+ "next_page_url": null,
+ "key": "credentials"
+ }
+ }
+ '
+ ));
+
+ $actual = $this->twilio->notifications->v1->credentials->read();
+
+ $this->assertNotNull($actual);
+ }
+
+ public function testCreateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->notifications->v1->credentials->create("friendlyName", "gcm");
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $values = array(
+ 'FriendlyName' => "friendlyName",
+ 'Type' => "gcm",
+ );
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://notifications.twilio.com/v1/Credentials',
+ null,
+ $values
+ )));
+ }
+
+ public function testCreateResponse() {
+ $this->holodeck->mock(new Response(
+ 201,
+ '
+ {
+ "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "Test slow create",
+ "type": "apn",
+ "sandbox": "False",
+ "date_created": "2015-10-07T17:50:01Z",
+ "date_updated": "2015-10-07T17:50:01Z",
+ "url": "https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->notifications->v1->credentials->create("friendlyName", "gcm");
+
+ $this->assertNotNull($actual);
+ }
+
+ public function testFetchRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+ )));
+ }
+
+ public function testFetchResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "Test slow create",
+ "type": "apn",
+ "sandbox": "False",
+ "date_created": "2015-10-07T17:50:01Z",
+ "date_updated": "2015-10-07T17:50:01Z",
+ "url": "https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
+
+ $this->assertNotNull($actual);
+ }
+
+ public function testUpdateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("friendlyName", "gcm");
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $values = array(
+ 'FriendlyName' => "friendlyName",
+ 'Type' => "gcm",
+ );
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
+ null,
+ $values
+ )));
+ }
+
+ public function testUpdateResponse() {
+ $this->holodeck->mock(new Response(
+ 200,
+ '
+ {
+ "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "friendly_name": "Test slow create",
+ "type": "apn",
+ "sandbox": "False",
+ "date_created": "2015-10-07T17:50:01Z",
+ "date_updated": "2015-10-07T17:50:01Z",
+ "url": "https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+ }
+ '
+ ));
+
+ $actual = $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("friendlyName", "gcm");
+
+ $this->assertNotNull($actual);
+ }
+
+ public function testDeleteRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'delete',
+ 'https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+ )));
+ }
+
+ public function testDeleteResponse() {
+ $this->holodeck->mock(new Response(
+ 204,
+ null
+ ));
+
+ $actual = $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete();
+
+ $this->assertTrue($actual);
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php b/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php
index 9b2a4d7..99c797c 100644
--- a/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php
+++ b/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php
@@ -202,7 +202,7 @@ class BindingTest extends HolodeckTestCase {
"first_page_url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=1&Page=0",
"previous_page_url": null,
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=1&Page=0",
- "next_page_url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=1&Page=1&PageToken=PABSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ "next_page_url": null,
"key": "bindings"
},
"bindings": []
diff --git a/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php b/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php
index 64666ab..0b1e7cd 100644
--- a/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php
+++ b/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php
@@ -52,7 +52,9 @@ class NotificationTest extends HolodeckTestCase {
"action": null,
"data": null,
"apn": null,
- "gcm": null
+ "gcm": null,
+ "sms": null,
+ "facebook_messenger": null
}
'
));
diff --git a/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php b/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php
index 93958d3..ae9205f 100644
--- a/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php
+++ b/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php
@@ -42,6 +42,8 @@ class ServiceTest extends HolodeckTestCase {
"date_updated": "2016-03-09T20:22:31Z",
"apn_credential_sid": null,
"gcm_credential_sid": null,
+ "messaging_service_sid": null,
+ "facebook_messenger_page_id": "4",
"default_apn_notification_protocol_version": "3",
"default_gcm_notification_protocol_version": "3",
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -109,6 +111,8 @@ class ServiceTest extends HolodeckTestCase {
"date_updated": "2016-03-09T20:22:31Z",
"apn_credential_sid": null,
"gcm_credential_sid": null,
+ "messaging_service_sid": null,
+ "facebook_messenger_page_id": "4",
"default_apn_notification_protocol_version": "3",
"default_gcm_notification_protocol_version": "3",
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -162,6 +166,8 @@ class ServiceTest extends HolodeckTestCase {
"date_updated": "2016-03-09T20:22:31Z",
"apn_credential_sid": null,
"gcm_credential_sid": null,
+ "messaging_service_sid": null,
+ "facebook_messenger_page_id": "4",
"default_apn_notification_protocol_version": "3",
"default_gcm_notification_protocol_version": "3",
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -232,6 +238,8 @@ class ServiceTest extends HolodeckTestCase {
"gcm_credential_sid": null,
"default_apn_notification_protocol_version": "3",
"default_gcm_notification_protocol_version": "3",
+ "messaging_service_sid": null,
+ "facebook_messenger_page_id": "4",
"url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"links": {
"bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings",
diff --git a/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php b/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php
new file mode 100644
index 0000000..260c95d
--- /dev/null
+++ b/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php
@@ -0,0 +1,67 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Preview\Wireless;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class CommandTest extends HolodeckTestCase {
+ public function testFetchRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->commands("DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://preview.twilio.com/wireless/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+ )));
+ }
+
+ public function testReadRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->commands->read();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://preview.twilio.com/wireless/Commands'
+ )));
+ }
+
+ public function testCreateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->commands->create("device", "command");
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $values = array(
+ 'Device' => "device",
+ 'Command' => "command",
+ );
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://preview.twilio.com/wireless/Commands',
+ null,
+ $values
+ )));
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Preview/Wireless/Device/UsageTest.php b/Twilio/Tests/Integration/Preview/Wireless/Device/UsageTest.php
new file mode 100644
index 0000000..b9a2b9e
--- /dev/null
+++ b/Twilio/Tests/Integration/Preview/Wireless/Device/UsageTest.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Preview\Wireless\Device;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class UsageTest extends HolodeckTestCase {
+ public function testFetchRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->devices("sid")
+ ->usage()->fetch();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://preview.twilio.com/wireless/Devices/sid/Usage'
+ )));
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Preview/Wireless/DeviceTest.php b/Twilio/Tests/Integration/Preview/Wireless/DeviceTest.php
new file mode 100644
index 0000000..e2ad327
--- /dev/null
+++ b/Twilio/Tests/Integration/Preview/Wireless/DeviceTest.php
@@ -0,0 +1,80 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Preview\Wireless;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class DeviceTest extends HolodeckTestCase {
+ public function testFetchRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->devices("sid")->fetch();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://preview.twilio.com/wireless/Devices/sid'
+ )));
+ }
+
+ public function testReadRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->devices->read();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://preview.twilio.com/wireless/Devices'
+ )));
+ }
+
+ public function testCreateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->devices->create("ratePlan");
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $values = array(
+ 'RatePlan' => "ratePlan",
+ );
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://preview.twilio.com/wireless/Devices',
+ null,
+ $values
+ )));
+ }
+
+ public function testUpdateRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->devices("sid")->update();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'post',
+ 'https://preview.twilio.com/wireless/Devices/sid'
+ )));
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php b/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php
new file mode 100644
index 0000000..4d9fc5d
--- /dev/null
+++ b/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * This code was generated by
+ * \ / _ _ _| _ _
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
+ * / /
+ */
+
+namespace Twilio\Tests\Integration\Preview\Wireless;
+
+use Twilio\Exceptions\DeserializeException;
+use Twilio\Exceptions\TwilioException;
+use Twilio\Http\Response;
+use Twilio\Tests\HolodeckTestCase;
+use Twilio\Tests\Request;
+
+class RatePlanTest extends HolodeckTestCase {
+ public function testReadRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->ratePlans->read();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://preview.twilio.com/wireless/RatePlans'
+ )));
+ }
+
+ public function testFetchRequest() {
+ $this->holodeck->mock(new Response(500, ''));
+
+ try {
+ $this->twilio->preview->wireless->ratePlans("sid")->fetch();
+ } catch (DeserializeException $e) {}
+ catch (TwilioException $e) {}
+
+ $this->assertTrue($this->holodeck->hasRequest(new Request(
+ 'get',
+ 'https://preview.twilio.com/wireless/RatePlans/sid'
+ )));
+ }
+} \ No newline at end of file
diff --git a/Twilio/Tests/Unit/SerializeTest.php b/Twilio/Tests/Unit/SerializeTest.php
new file mode 100644
index 0000000..5b036f1
--- /dev/null
+++ b/Twilio/Tests/Unit/SerializeTest.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace Twilio\Tests\Unit;
+
+use Twilio\Serialize;
+
+class SerializeTest extends UnitTest {
+
+ public function testNull() {
+ $actual = Serialize::prefixedCollapsibleMap(null, "Prefix");
+ $this->assertEquals(array(), $actual);
+ }
+
+ public function testEmptyArray() {
+ $actual = Serialize::prefixedCollapsibleMap(array(), "Prefix");
+ $this->assertEquals(array(), $actual);
+ }
+
+ public function testSingleKey() {
+ $actual = Serialize::prefixedCollapsibleMap(array(
+ "foo" => "bar"
+ ), "Prefix");
+ $this->assertEquals(array(
+ "Prefix.foo" => "bar"
+ ), $actual);
+ }
+
+ public function testNestedKey() {
+ $actual = Serialize::prefixedCollapsibleMap(array(
+ "foo" => array(
+ "bar" => "baz"
+ )
+ ), "Prefix");
+ $this->assertEquals(array(
+ "Prefix.foo.bar" => "baz"
+ ), $actual);
+ }
+
+ public function testMultipleKeys() {
+ $actual = Serialize::prefixedCollapsibleMap(array(
+ "watson" => array(
+ "language" => "en",
+ "alice" => "bob"
+ ),
+ "foo" => "bar"
+ ), "Prefix");
+ $this->assertEquals(array(
+ "Prefix.watson.language" => "en",
+ "Prefix.watson.alice" => "bob",
+ "Prefix.foo" => "bar"
+ ), $actual);
+ }
+
+}
diff --git a/Twilio/Version.php b/Twilio/Version.php
index 5fde8ae..652eb57 100644
--- a/Twilio/Version.php
+++ b/Twilio/Version.php
@@ -76,7 +76,7 @@ abstract class Version {
$timeout
);
- if ($response->getStatusCode() != 200) {
+ if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
throw new TwilioException('Unable to fetch record', $response->getStatusCode());
}
@@ -97,7 +97,7 @@ abstract class Version {
$timeout
);
- if ($response->getStatusCode() != 200) {
+ if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
throw new TwilioException('Unable to update record', $response->getStatusCode());
}
@@ -118,7 +118,7 @@ abstract class Version {
$timeout
);
- if (500 <= $response->getStatusCode() && $response->getStatusCode() < 600) {
+ if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
throw new TwilioException('Unable to delete record', $response->getStatusCode());
}
@@ -175,7 +175,7 @@ abstract class Version {
$timeout
);
- if (!($response->getStatusCode() == 200 || $response->getStatusCode() == 201)) {
+ if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) {
throw new TwilioException('Unable to create record', $response->getStatusCode());
}
diff --git a/Twilio/VersionInfo.php b/Twilio/VersionInfo.php
index 7df34ea..2c8eded 100644
--- a/Twilio/VersionInfo.php
+++ b/Twilio/VersionInfo.php
@@ -7,7 +7,7 @@ namespace Twilio;
class VersionInfo {
const MAJOR = 5;
const MINOR = 0;
- const PATCH = '0-RC3';
+ const PATCH = '0-RC8';
public static function string() {
return implode('.', array(self::MAJOR, self::MINOR, self::PATCH));