diff options
author | matt <matt@twilio.com> | 2016-08-15 12:21:30 -0700 |
---|---|---|
committer | matt <matt@twilio.com> | 2016-08-15 12:21:30 -0700 |
commit | eaf6ba023eb35b834e8a9d7f2b8cba9637b0cdb8 (patch) | |
tree | 2da9b8311feb3a814418452033cf30bc838a9f0a | |
parent | 584b33f4f6b7ffab28e9ad3554d3dca44e734dfd (diff) | |
download | twilio-php-origin/next-gen.zip twilio-php-origin/next-gen.tar.gz twilio-php-origin/next-gen.tar.bz2 |
Mainline generation for GA releaseorigin/next-gen
44 files changed, 17 insertions, 4665 deletions
diff --git a/Twilio/Rest/Client.php b/Twilio/Rest/Client.php index 4700cb4..d00a071 100644 --- a/Twilio/Rest/Client.php +++ b/Twilio/Rest/Client.php @@ -22,8 +22,6 @@ use Twilio\VersionInfo; * @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 @@ -41,6 +39,7 @@ use Twilio\VersionInfo; * @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 @@ -63,6 +62,7 @@ use Twilio\VersionInfo; * @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) @@ -85,8 +85,6 @@ class Client { protected $_ipMessaging = null; protected $_lookups = null; protected $_monitor = null; - protected $_notifications = null; - protected $_preview = null; protected $_pricing = null; protected $_taskrouter = null; protected $_trunking = null; @@ -443,6 +441,21 @@ class Client { } /** + * @return \Twilio\Rest\Api\V2010\Account\NotificationList + */ + protected function getNotifications() { + return $this->api->v2010->account->notifications; + } + + /** + * @param string $sid Fetch by unique notification Sid + * @return \Twilio\Rest\Api\V2010\Account\NotificationContext + */ + protected function contextNotifications($sid) { + return $this->api->v2010->account->notifications($sid); + } + + /** * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList */ protected function getOutgoingCallerIds() { @@ -611,30 +624,6 @@ class Client { } /** - * Access the Notifications Twilio Domain - * - * @return \Twilio\Rest\Notifications Notifications Twilio Domain - */ - protected function getNotifications() { - if (!$this->_notifications) { - $this->_notifications = new Notifications($this); - } - return $this->_notifications; - } - - /** - * 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/Notifications.php b/Twilio/Rest/Notifications.php deleted file mode 100644 index bc8c6bd..0000000 --- a/Twilio/Rest/Notifications.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest; - -use Twilio\Domain; -use Twilio\Exceptions\TwilioException; -use Twilio\Rest\Notifications\V1; - -/** - * @property \Twilio\Rest\Notifications\V1 v1 - * @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 Notifications extends Domain { - protected $_v1 = null; - - /** - * Construct the Notifications Domain - * - * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with - * Twilio - * @return \Twilio\Rest\Notifications Domain for Notifications - */ - public function __construct(Client $client) { - parent::__construct($client); - - $this->baseUrl = 'https://notifications.twilio.com'; - } - - /** - * @return \Twilio\Rest\Notifications\V1 Version v1 of notifications - */ - protected function getV1() { - if (!$this->_v1) { - $this->_v1 = new V1($this); - } - return $this->_v1; - } - - /** - * Magic getter to lazy load version - * - * @param string $name Version to return - * @return \Twilio\Version The requested version - * @throws \Twilio\Exceptions\TwilioException For unknown versions - */ - public function __get($name) { - $method = 'get' . ucfirst($name); - if (method_exists($this, $method)) { - return $this->$method(); - } - - throw new TwilioException('Unknown version ' . $name); - } - - /** - * Magic caller to get resource contexts - * - * @param string $name Resource to return - * @param array $arguments Context parameters - * @return \Twilio\InstanceContext The requested resource context - * @throws \Twilio\Exceptions\TwilioException For unknown resource - */ - public function __call($name, $arguments) { - $method = 'context' . ucfirst($name); - if (method_exists($this, $method)) { - return call_user_func_array(array($this, $method), $arguments); - } - - throw new TwilioException('Unknown context ' . $name); - } - - /** - * @return \Twilio\Rest\Notifications\V1\CredentialList - */ - protected function getCredentials() { - return $this->v1->credentials; - } - - /** - * @param string $sid The sid - * @return \Twilio\Rest\Notifications\V1\CredentialContext - */ - protected function contextCredentials($sid) { - return $this->v1->credentials($sid); - } - - /** - * @return \Twilio\Rest\Notifications\V1\ServiceList - */ - protected function getServices() { - return $this->v1->services; - } - - /** - * @param string $sid The sid - * @return \Twilio\Rest\Notifications\V1\ServiceContext - */ - protected function contextServices($sid) { - return $this->v1->services($sid); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1.php b/Twilio/Rest/Notifications/V1.php deleted file mode 100644 index db82f56..0000000 --- a/Twilio/Rest/Notifications/V1.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -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; - - /** - * Construct the V1 version of Notifications - * - * @param \Twilio\Domain $domain Domain that contains the version - * @return \Twilio\Rest\Notifications\V1 V1 version of Notifications - */ - public function __construct(Domain $domain) { - parent::__construct($domain); - $this->version = 'v1'; - } - - /** - * @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() { - if (!$this->_services) { - $this->_services = new ServiceList($this); - } - return $this->_services; - } - - /** - * Magic getter to lazy load root resources - * - * @param string $name Resource to return - * @return \Twilio\ListResource The requested resource - * @throws \Twilio\Exceptions\TwilioException For unknown resource - */ - public function __get($name) { - $method = 'get' . ucfirst($name); - if (method_exists($this, $method)) { - return $this->$method(); - } - - throw new TwilioException('Unknown resource ' . $name); - } - - /** - * Magic caller to get resource contexts - * - * @param string $name Resource to return - * @param array $arguments Context parameters - * @return \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.Notifications.V1]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/CredentialContext.php b/Twilio/Rest/Notifications/V1/CredentialContext.php deleted file mode 100644 index 94e7b0d..0000000 --- a/Twilio/Rest/Notifications/V1/CredentialContext.php +++ /dev/null @@ -1,108 +0,0 @@ -<?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 array $options Optional Arguments - * @return CredentialInstance Updated CredentialInstance - */ - public function update(array $options = array()) { - $options = new Values($options); - - $data = Values::of(array( - 'FriendlyName' => $options['friendlyName'], - '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 deleted file mode 100644 index 9a77938..0000000 --- a/Twilio/Rest/Notifications/V1/CredentialInstance.php +++ /dev/null @@ -1,136 +0,0 @@ -<?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 array $options Optional Arguments - * @return CredentialInstance Updated CredentialInstance - */ - public function update(array $options = array()) { - return $this->proxy()->update( - $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/Notifications/V1/CredentialList.php b/Twilio/Rest/Notifications/V1/CredentialList.php deleted file mode 100644 index 19e8d96..0000000 --- a/Twilio/Rest/Notifications/V1/CredentialList.php +++ /dev/null @@ -1,155 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1; - -use Twilio\ListResource; -use Twilio\Values; -use Twilio\Version; - -class CredentialList extends ListResource { - /** - * Construct the CredentialList - * - * @param Version $version Version that contains the resource - * @return \Twilio\Rest\Notifications\V1\CredentialList - */ - public function __construct(Version $version) { - parent::__construct($version); - - // Path Solution - $this->solution = array(); - - $this->uri = '/Credentials'; - } - - /** - * Streams CredentialInstance records from the API as a generator stream. - * This operation lazily loads records as efficiently as possible until the - * limit - * is reached. - * The results are returned as a generator, so this operation is memory - * efficient. - * - * @param int $limit Upper limit for the number of records to return. stream() - * guarantees to never return more than limit. Default is no - * limit - * @param mixed $pageSize Number of records to fetch per request, when not set - * will use the default value of 50 records. If no - * page_size is defined but a limit is defined, stream() - * will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - * @return \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 CredentialInstance records from the API as a list. - * Unlike stream(), this operation is eager and will load `limit` records into - * memory before returning. - * - * @param int $limit Upper limit for the number of records to return. read() - * guarantees to never return more than limit. Default is no - * limit - * @param mixed $pageSize Number of records to fetch per request, when not set - * will use the default value of 50 records. If no - * page_size is defined but a limit is defined, read() - * will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - * @return CredentialInstance[] Array of results - */ - public function read($limit = null, $pageSize = Values::NONE) { - return iterator_to_array($this->stream($limit, $pageSize), false); - } - - /** - * Retrieve a single page of CredentialInstance records from the API. - * Request is executed immediately - * - * @param mixed $pageSize Number of records to return, defaults to 50 - * @param string $pageToken PageToken provided by the API - * @param mixed $pageNumber Page Number, this value is simply for client state - * @return \Twilio\Page Page of CredentialInstance - */ - 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 CredentialPage($this->version, $response, $this->solution); - } - - /** - * Create a new CredentialInstance - * - * @param string $type The type - * @param array $options Optional Arguments - * @return CredentialInstance Newly created CredentialInstance - */ - public function create($type, array $options = array()) { - $options = new Values($options); - - $data = Values::of(array( - 'Type' => $type, - 'FriendlyName' => $options['friendlyName'], - 'Certificate' => $options['certificate'], - 'PrivateKey' => $options['privateKey'], - 'Sandbox' => $options['sandbox'], - 'ApiKey' => $options['apiKey'], - )); - - $payload = $this->version->create( - 'POST', - $this->uri, - array(), - $data - ); - - return new CredentialInstance( - $this->version, - $payload - ); - } - - /** - * Constructs a CredentialContext - * - * @param string $sid The sid - * @return \Twilio\Rest\Notifications\V1\CredentialContext - */ - public function getContext($sid) { - return new CredentialContext( - $this->version, - $sid - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications.V1.CredentialList]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/CredentialPage.php b/Twilio/Rest/Notifications/V1/CredentialPage.php deleted file mode 100644 index 89c55df..0000000 --- a/Twilio/Rest/Notifications/V1/CredentialPage.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1; - -use Twilio\Page; - -class CredentialPage extends Page { - public function __construct($version, $response, $solution) { - parent::__construct($version, $response); - - // Path Solution - $this->solution = $solution; - } - - public function buildInstance(array $payload) { - return new CredentialInstance( - $this->version, - $payload - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications.V1.CredentialPage]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/Service/BindingContext.php b/Twilio/Rest/Notifications/V1/Service/BindingContext.php deleted file mode 100644 index e867b41..0000000 --- a/Twilio/Rest/Notifications/V1/Service/BindingContext.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1\Service; - -use Twilio\InstanceContext; -use Twilio\Values; -use Twilio\Version; - -class BindingContext extends InstanceContext { - /** - * Initialize the BindingContext - * - * @param \Twilio\Version $version Version that contains the resource - * @param string $serviceSid The service_sid - * @param string $sid The sid - * @return \Twilio\Rest\Notifications\V1\Service\BindingContext - */ - public function __construct(Version $version, $serviceSid, $sid) { - parent::__construct($version); - - // Path Solution - $this->solution = array( - 'serviceSid' => $serviceSid, - 'sid' => $sid, - ); - - $this->uri = '/Services/' . $serviceSid . '/Bindings/' . $sid . ''; - } - - /** - * Fetch a BindingInstance - * - * @return BindingInstance Fetched BindingInstance - */ - public function fetch() { - $params = Values::of(array()); - - $payload = $this->version->fetch( - 'GET', - $this->uri, - $params - ); - - return new BindingInstance( - $this->version, - $payload, - $this->solution['serviceSid'], - $this->solution['sid'] - ); - } - - /** - * Deletes the BindingInstance - * - * @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.BindingContext ' . implode(' ', $context) . ']'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/Service/BindingInstance.php b/Twilio/Rest/Notifications/V1/Service/BindingInstance.php deleted file mode 100644 index 6c91a5b..0000000 --- a/Twilio/Rest/Notifications/V1/Service/BindingInstance.php +++ /dev/null @@ -1,136 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1\Service; - -use Twilio\Deserialize; -use Twilio\Exceptions\TwilioException; -use Twilio\InstanceResource; -use Twilio\Version; - -/** - * @property string sid - * @property string accountSid - * @property string serviceSid - * @property \DateTime dateCreated - * @property \DateTime dateUpdated - * @property string notificationProtocolVersion - * @property string endpoint - * @property string identity - * @property string bindingType - * @property string address - * @property string tags - * @property string url - */ -class BindingInstance extends InstanceResource { - /** - * Initialize the BindingInstance - * - * @param \Twilio\Version $version Version that contains the resource - * @param mixed[] $payload The response payload - * @param string $serviceSid The service_sid - * @param string $sid The sid - * @return \Twilio\Rest\Notifications\V1\Service\BindingInstance - */ - public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { - parent::__construct($version); - - // Marshaled Properties - $this->properties = array( - 'sid' => $payload['sid'], - 'accountSid' => $payload['account_sid'], - 'serviceSid' => $payload['service_sid'], - 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']), - 'dateUpdated' => Deserialize::iso8601DateTime($payload['date_updated']), - 'notificationProtocolVersion' => $payload['notification_protocol_version'], - 'endpoint' => $payload['endpoint'], - 'identity' => $payload['identity'], - 'bindingType' => $payload['binding_type'], - 'address' => $payload['address'], - 'tags' => $payload['tags'], - 'url' => $payload['url'], - ); - - $this->solution = array( - 'serviceSid' => $serviceSid, - 'sid' => $sid ?: $this->properties['sid'], - ); - } - - /** - * Generate an instance context for the instance, the context is capable of - * performing various actions. All instance actions are proxied to the context - * - * @return \Twilio\Rest\Notifications\V1\Service\BindingContext Context for - * this - * BindingInstance - */ - protected function proxy() { - if (!$this->context) { - $this->context = new BindingContext( - $this->version, - $this->solution['serviceSid'], - $this->solution['sid'] - ); - } - - return $this->context; - } - - /** - * Fetch a BindingInstance - * - * @return BindingInstance Fetched BindingInstance - */ - public function fetch() { - return $this->proxy()->fetch(); - } - - /** - * Deletes the BindingInstance - * - * @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.BindingInstance ' . implode(' ', $context) . ']'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/Service/BindingList.php b/Twilio/Rest/Notifications/V1/Service/BindingList.php deleted file mode 100644 index 2b5260e..0000000 --- a/Twilio/Rest/Notifications/V1/Service/BindingList.php +++ /dev/null @@ -1,175 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1\Service; - -use Twilio\ListResource; -use Twilio\Values; -use Twilio\Version; - -class BindingList extends ListResource { - /** - * Construct the BindingList - * - * @param Version $version Version that contains the resource - * @param string $serviceSid The service_sid - * @return \Twilio\Rest\Notifications\V1\Service\BindingList - */ - public function __construct(Version $version, $serviceSid) { - parent::__construct($version); - - // Path Solution - $this->solution = array( - 'serviceSid' => $serviceSid, - ); - - $this->uri = '/Services/' . $serviceSid . '/Bindings'; - } - - /** - * Create a new BindingInstance - * - * @param string $endpoint The endpoint - * @param string $identity The identity - * @param string $bindingType The binding_type - * @param string $address The address - * @param array $options Optional Arguments - * @return BindingInstance Newly created BindingInstance - */ - public function create($endpoint, $identity, $bindingType, $address, array $options = array()) { - $options = new Values($options); - - $data = Values::of(array( - 'Endpoint' => $endpoint, - 'Identity' => $identity, - 'BindingType' => $bindingType, - 'Address' => $address, - 'Tag' => $options['tag'], - 'NotificationProtocolVersion' => $options['notificationProtocolVersion'], - )); - - $payload = $this->version->create( - 'POST', - $this->uri, - array(), - $data - ); - - return new BindingInstance( - $this->version, - $payload, - $this->solution['serviceSid'] - ); - } - - /** - * Streams BindingInstance records from the API as a generator stream. - * This operation lazily loads records as efficiently as possible until the - * limit - * is reached. - * The results are returned as a generator, so this operation is memory - * efficient. - * - * @param array $options Optional Arguments - * @param int $limit Upper limit for the number of records to return. stream() - * guarantees to never return more than limit. Default is no - * limit - * @param mixed $pageSize Number of records to fetch per request, when not set - * will use the default value of 50 records. If no - * page_size is defined 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 BindingInstance records from the API as a list. - * Unlike stream(), this operation is eager and will load `limit` records into - * memory before returning. - * - * @param array $options Optional Arguments - * @param int $limit Upper limit for the number of records to return. read() - * guarantees to never return more than limit. Default is no - * limit - * @param mixed $pageSize Number of records to fetch per request, when not set - * will use the default value of 50 records. If no - * page_size is defined but a limit is defined, read() - * will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - * @return BindingInstance[] Array of results - */ - public function read(array $options = array(), $limit = null, $pageSize = Values::NONE) { - return iterator_to_array($this->stream($options, $limit, $pageSize), false); - } - - /** - * Retrieve a single page of BindingInstance records from the API. - * Request is executed immediately - * - * @param array $options 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 BindingInstance - */ - public function page(array $options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { - $options = new Values($options); - $params = Values::of(array( - 'StartDate<' => $options['startdateBefore'], - 'StartDate' => $options['startDate'], - 'StartDate>' => $options['startdateAfter'], - 'EndDate<' => $options['enddateBefore'], - 'EndDate' => $options['endDate'], - 'EndDate>' => $options['enddateAfter'], - 'Identity' => $options['identity'], - 'Tag' => $options['tag'], - 'PageToken' => $pageToken, - 'Page' => $pageNumber, - 'PageSize' => $pageSize, - )); - - $response = $this->version->page( - 'GET', - $this->uri, - $params - ); - - return new BindingPage($this->version, $response, $this->solution); - } - - /** - * Constructs a BindingContext - * - * @param string $sid The sid - * @return \Twilio\Rest\Notifications\V1\Service\BindingContext - */ - public function getContext($sid) { - return new BindingContext( - $this->version, - $this->solution['serviceSid'], - $sid - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications.V1.BindingList]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/Service/BindingPage.php b/Twilio/Rest/Notifications/V1/Service/BindingPage.php deleted file mode 100644 index 56c0d4c..0000000 --- a/Twilio/Rest/Notifications/V1/Service/BindingPage.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1\Service; - -use Twilio\Page; - -class BindingPage extends Page { - public function __construct($version, $response, $solution) { - parent::__construct($version, $response); - - // Path Solution - $this->solution = $solution; - } - - public function buildInstance(array $payload) { - return new BindingInstance( - $this->version, - $payload, - $this->solution['serviceSid'] - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications.V1.BindingPage]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/Service/NotificationInstance.php b/Twilio/Rest/Notifications/V1/Service/NotificationInstance.php deleted file mode 100644 index 4e1998f..0000000 --- a/Twilio/Rest/Notifications/V1/Service/NotificationInstance.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1\Service; - -use Twilio\Deserialize; -use Twilio\Exceptions\TwilioException; -use Twilio\InstanceResource; -use Twilio\Version; - -/** - * @property string sid - * @property string accountSid - * @property string serviceSid - * @property \DateTime dateCreated - * @property string identities - * @property string tags - * @property string priority - * @property string ttl - * @property string title - * @property string body - * @property string sound - * @property string action - * @property string data - * @property string apn - * @property string gcm - * @property string sms - * @property string facebookMessenger - */ -class NotificationInstance extends InstanceResource { - /** - * Initialize the NotificationInstance - * - * @param \Twilio\Version $version Version that contains the resource - * @param mixed[] $payload The response payload - * @param string $serviceSid The service_sid - * @return \Twilio\Rest\Notifications\V1\Service\NotificationInstance - */ - public function __construct(Version $version, array $payload, $serviceSid) { - parent::__construct($version); - - // Marshaled Properties - $this->properties = array( - 'sid' => $payload['sid'], - 'accountSid' => $payload['account_sid'], - 'serviceSid' => $payload['service_sid'], - 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']), - 'identities' => $payload['identities'], - 'tags' => $payload['tags'], - 'priority' => $payload['priority'], - 'ttl' => $payload['ttl'], - 'title' => $payload['title'], - 'body' => $payload['body'], - 'sound' => $payload['sound'], - 'action' => $payload['action'], - 'data' => $payload['data'], - 'apn' => $payload['apn'], - 'gcm' => $payload['gcm'], - 'sms' => $payload['sms'], - 'facebookMessenger' => $payload['facebook_messenger'], - ); - - $this->solution = array( - 'serviceSid' => $serviceSid, - ); - } - - /** - * Magic getter to access properties - * - * @param string $name Property to access - * @return mixed The requested property - * @throws TwilioException For unknown properties - */ - public function __get($name) { - if (array_key_exists($name, $this->properties)) { - return $this->properties[$name]; - } - - if (property_exists($this, '_' . $name)) { - $method = '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.Notifications.V1.NotificationInstance]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/Service/NotificationList.php b/Twilio/Rest/Notifications/V1/Service/NotificationList.php deleted file mode 100644 index 9e3e963..0000000 --- a/Twilio/Rest/Notifications/V1/Service/NotificationList.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1\Service; - -use Twilio\ListResource; -use Twilio\Values; -use Twilio\Version; - -class NotificationList extends ListResource { - /** - * Construct the NotificationList - * - * @param Version $version Version that contains the resource - * @param string $serviceSid The service_sid - * @return \Twilio\Rest\Notifications\V1\Service\NotificationList - */ - public function __construct(Version $version, $serviceSid) { - parent::__construct($version); - - // Path Solution - $this->solution = array( - 'serviceSid' => $serviceSid, - ); - - $this->uri = '/Services/' . $serviceSid . '/Notifications'; - } - - /** - * Create a new NotificationInstance - * - * @param array $options Optional Arguments - * @return NotificationInstance Newly created NotificationInstance - */ - public function create(array $options = array()) { - $options = new Values($options); - - $data = Values::of(array( - 'Identity' => $options['identity'], - 'Tag' => $options['tag'], - 'Body' => $options['body'], - 'Priority' => $options['priority'], - 'Ttl' => $options['ttl'], - 'Title' => $options['title'], - 'Sound' => $options['sound'], - 'Action' => $options['action'], - 'Data' => $options['data'], - 'Apn' => $options['apn'], - 'Gcm' => $options['gcm'], - 'Sms' => $options['sms'], - 'FacebookMessenger' => $options['facebookMessenger'], - )); - - $payload = $this->version->create( - 'POST', - $this->uri, - array(), - $data - ); - - return new NotificationInstance( - $this->version, - $payload, - $this->solution['serviceSid'] - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications.V1.NotificationList]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/Service/NotificationPage.php b/Twilio/Rest/Notifications/V1/Service/NotificationPage.php deleted file mode 100644 index 7223637..0000000 --- a/Twilio/Rest/Notifications/V1/Service/NotificationPage.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1\Service; - -use Twilio\Page; - -class NotificationPage extends Page { - public function __construct($version, $response, $solution) { - parent::__construct($version, $response); - - // Path Solution - $this->solution = $solution; - } - - public function buildInstance(array $payload) { - return new NotificationInstance( - $this->version, - $payload, - $this->solution['serviceSid'] - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications.V1.NotificationPage]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/ServiceContext.php b/Twilio/Rest/Notifications/V1/ServiceContext.php deleted file mode 100644 index b290eda..0000000 --- a/Twilio/Rest/Notifications/V1/ServiceContext.php +++ /dev/null @@ -1,186 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1; - -use Twilio\Exceptions\TwilioException; -use Twilio\InstanceContext; -use Twilio\Rest\Notifications\V1\Service\BindingList; -use Twilio\Rest\Notifications\V1\Service\NotificationList; -use Twilio\Values; -use Twilio\Version; - -/** - * @property \Twilio\Rest\Notifications\V1\Service\BindingList bindings - * @property \Twilio\Rest\Notifications\V1\Service\NotificationList notifications - * @method \Twilio\Rest\Notifications\V1\Service\BindingContext bindings(string $sid) - */ -class ServiceContext extends InstanceContext { - protected $_bindings = null; - protected $_notifications = null; - - /** - * Initialize the ServiceContext - * - * @param \Twilio\Version $version Version that contains the resource - * @param string $sid The sid - * @return \Twilio\Rest\Notifications\V1\ServiceContext - */ - public function __construct(Version $version, $sid) { - parent::__construct($version); - - // Path Solution - $this->solution = array( - 'sid' => $sid, - ); - - $this->uri = '/Services/' . $sid . ''; - } - - /** - * Deletes the ServiceInstance - * - * @return boolean True if delete succeeds, false otherwise - */ - public function delete() { - return $this->version->delete('delete', $this->uri); - } - - /** - * Fetch a ServiceInstance - * - * @return ServiceInstance Fetched ServiceInstance - */ - public function fetch() { - $params = Values::of(array()); - - $payload = $this->version->fetch( - 'GET', - $this->uri, - $params - ); - - return new ServiceInstance( - $this->version, - $payload, - $this->solution['sid'] - ); - } - - /** - * Update the ServiceInstance - * - * @param array $options Optional Arguments - * @return ServiceInstance Updated ServiceInstance - */ - public function update(array $options = array()) { - $options = new Values($options); - - $data = Values::of(array( - 'FriendlyName' => $options['friendlyName'], - 'ApnCredentialSid' => $options['apnCredentialSid'], - 'GcmCredentialSid' => $options['gcmCredentialSid'], - 'MessagingServiceSid' => $options['messagingServiceSid'], - 'FacebookMessengerPageId' => $options['facebookMessengerPageId'], - 'DefaultApnNotificationProtocolVersion' => $options['defaultApnNotificationProtocolVersion'], - 'DefaultGcmNotificationProtocolVersion' => $options['defaultGcmNotificationProtocolVersion'], - )); - - $payload = $this->version->update( - 'POST', - $this->uri, - array(), - $data - ); - - return new ServiceInstance( - $this->version, - $payload, - $this->solution['sid'] - ); - } - - /** - * Access the bindings - * - * @return \Twilio\Rest\Notifications\V1\Service\BindingList - */ - protected function getBindings() { - if (!$this->_bindings) { - $this->_bindings = new BindingList( - $this->version, - $this->solution['sid'] - ); - } - - return $this->_bindings; - } - - /** - * Access the notifications - * - * @return \Twilio\Rest\Notifications\V1\Service\NotificationList - */ - protected function getNotifications() { - if (!$this->_notifications) { - $this->_notifications = new NotificationList( - $this->version, - $this->solution['sid'] - ); - } - - return $this->_notifications; - } - - /** - * Magic getter to lazy load subresources - * - * @param string $name Subresource to return - * @return \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() { - $context = array(); - foreach ($this->solution as $key => $value) { - $context[] = "$key=$value"; - } - return '[Twilio.Notifications.V1.ServiceContext ' . implode(' ', $context) . ']'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/ServiceInstance.php b/Twilio/Rest/Notifications/V1/ServiceInstance.php deleted file mode 100644 index 31ce67b..0000000 --- a/Twilio/Rest/Notifications/V1/ServiceInstance.php +++ /dev/null @@ -1,167 +0,0 @@ -<?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 \DateTime dateCreated - * @property \DateTime dateUpdated - * @property string apnCredentialSid - * @property string gcmCredentialSid - * @property string messagingServiceSid - * @property string facebookMessengerPageId - * @property string defaultApnNotificationProtocolVersion - * @property string defaultGcmNotificationProtocolVersion - * @property string url - * @property string links - */ -class ServiceInstance extends InstanceResource { - protected $_bindings = null; - protected $_notifications = null; - - /** - * Initialize the ServiceInstance - * - * @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\ServiceInstance - */ - 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'], - 'dateCreated' => Deserialize::iso8601DateTime($payload['date_created']), - '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'], - '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\Notifications\V1\ServiceContext Context for this - * ServiceInstance - */ - protected function proxy() { - if (!$this->context) { - $this->context = new ServiceContext( - $this->version, - $this->solution['sid'] - ); - } - - return $this->context; - } - - /** - * Deletes the ServiceInstance - * - * @return boolean True if delete succeeds, false otherwise - */ - public function delete() { - return $this->proxy()->delete(); - } - - /** - * Fetch a ServiceInstance - * - * @return ServiceInstance Fetched ServiceInstance - */ - public function fetch() { - return $this->proxy()->fetch(); - } - - /** - * Update the ServiceInstance - * - * @param array $options Optional Arguments - * @return ServiceInstance Updated ServiceInstance - */ - public function update(array $options = array()) { - return $this->proxy()->update( - $options - ); - } - - /** - * Access the bindings - * - * @return \Twilio\Rest\Notifications\V1\Service\BindingList - */ - protected function getBindings() { - return $this->proxy()->bindings; - } - - /** - * Access the notifications - * - * @return \Twilio\Rest\Notifications\V1\Service\NotificationList - */ - protected function getNotifications() { - return $this->proxy()->notifications; - } - - /** - * Magic getter to access properties - * - * @param string $name Property to access - * @return mixed The requested property - * @throws TwilioException For unknown properties - */ - public function __get($name) { - if (array_key_exists($name, $this->properties)) { - return $this->properties[$name]; - } - - if (property_exists($this, '_' . $name)) { - $method = '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.ServiceInstance ' . implode(' ', $context) . ']'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/ServiceList.php b/Twilio/Rest/Notifications/V1/ServiceList.php deleted file mode 100644 index d8aef20..0000000 --- a/Twilio/Rest/Notifications/V1/ServiceList.php +++ /dev/null @@ -1,160 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1; - -use Twilio\ListResource; -use Twilio\Values; -use Twilio\Version; - -class ServiceList extends ListResource { - /** - * Construct the ServiceList - * - * @param Version $version Version that contains the resource - * @return \Twilio\Rest\Notifications\V1\ServiceList - */ - public function __construct(Version $version) { - parent::__construct($version); - - // Path Solution - $this->solution = array(); - - $this->uri = '/Services'; - } - - /** - * Create a new ServiceInstance - * - * @param array $options Optional Arguments - * @return ServiceInstance Newly created ServiceInstance - */ - public function create(array $options = array()) { - $options = new Values($options); - - $data = Values::of(array( - 'FriendlyName' => $options['friendlyName'], - 'ApnCredentialSid' => $options['apnCredentialSid'], - 'GcmCredentialSid' => $options['gcmCredentialSid'], - 'MessagingServiceSid' => $options['messagingServiceSid'], - 'FacebookMessengerPageId' => $options['facebookMessengerPageId'], - 'DefaultApnNotificationProtocolVersion' => $options['defaultApnNotificationProtocolVersion'], - 'DefaultGcmNotificationProtocolVersion' => $options['defaultGcmNotificationProtocolVersion'], - )); - - $payload = $this->version->create( - 'POST', - $this->uri, - array(), - $data - ); - - return new ServiceInstance( - $this->version, - $payload - ); - } - - /** - * Streams ServiceInstance records from the API as a generator stream. - * This operation lazily loads records as efficiently as possible until the - * limit - * is reached. - * The results are returned as a generator, so this operation is memory - * efficient. - * - * @param array $options Optional Arguments - * @param int $limit Upper limit for the number of records to return. stream() - * guarantees to never return more than limit. Default is no - * limit - * @param mixed $pageSize Number of records to fetch per request, when not set - * will use the default value of 50 records. If no - * page_size is defined 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 ServiceInstance records from the API as a list. - * Unlike stream(), this operation is eager and will load `limit` records into - * memory before returning. - * - * @param array $options Optional Arguments - * @param int $limit Upper limit for the number of records to return. read() - * guarantees to never return more than limit. Default is no - * limit - * @param mixed $pageSize Number of records to fetch per request, when not set - * will use the default value of 50 records. If no - * page_size is defined but a limit is defined, read() - * will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - * @return ServiceInstance[] Array of results - */ - public function read(array $options = array(), $limit = null, $pageSize = Values::NONE) { - return iterator_to_array($this->stream($options, $limit, $pageSize), false); - } - - /** - * Retrieve a single page of ServiceInstance records from the API. - * Request is executed immediately - * - * @param array $options 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 ServiceInstance - */ - public function page(array $options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { - $options = new Values($options); - $params = Values::of(array( - 'FriendlyName' => $options['friendlyName'], - 'PageToken' => $pageToken, - 'Page' => $pageNumber, - 'PageSize' => $pageSize, - )); - - $response = $this->version->page( - 'GET', - $this->uri, - $params - ); - - return new ServicePage($this->version, $response, $this->solution); - } - - /** - * Constructs a ServiceContext - * - * @param string $sid The sid - * @return \Twilio\Rest\Notifications\V1\ServiceContext - */ - public function getContext($sid) { - return new ServiceContext( - $this->version, - $sid - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications.V1.ServiceList]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Notifications/V1/ServicePage.php b/Twilio/Rest/Notifications/V1/ServicePage.php deleted file mode 100644 index b5bb9c9..0000000 --- a/Twilio/Rest/Notifications/V1/ServicePage.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Notifications\V1; - -use Twilio\Page; - -class ServicePage extends Page { - public function __construct($version, $response, $solution) { - parent::__construct($version, $response); - - // Path Solution - $this->solution = $solution; - } - - public function buildInstance(array $payload) { - return new ServiceInstance( - $this->version, - $payload - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Notifications.V1.ServicePage]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Preview.php b/Twilio/Rest/Preview.php deleted file mode 100644 index 35d79b9..0000000 --- a/Twilio/Rest/Preview.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest; - -use Twilio\Domain; -use Twilio\Exceptions\TwilioException; -use Twilio\Rest\Preview\Wireless; - -/** - * @property \Twilio\Rest\Preview\Wireless wireless - * @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 Preview extends Domain { - protected $_wireless = null; - - /** - * Construct the Preview Domain - * - * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with - * Twilio - * @return \Twilio\Rest\Preview Domain for Preview - */ - public function __construct(Client $client) { - parent::__construct($client); - - $this->baseUrl = 'https://preview.twilio.com'; - } - - /** - * @return \Twilio\Rest\Preview\Wireless Version wireless of preview - */ - protected function getWireless() { - if (!$this->_wireless) { - $this->_wireless = new Wireless($this); - } - return $this->_wireless; - } - - /** - * Magic getter to lazy load version - * - * @param string $name Version to return - * @return \Twilio\Version The requested version - * @throws \Twilio\Exceptions\TwilioException For unknown versions - */ - public function __get($name) { - $method = 'get' . ucfirst($name); - if (method_exists($this, $method)) { - return $this->$method(); - } - - throw new TwilioException('Unknown version ' . $name); - } - - /** - * Magic caller to get resource contexts - * - * @param string $name Resource to return - * @param array $arguments Context parameters - * @return \Twilio\InstanceContext The requested resource context - * @throws \Twilio\Exceptions\TwilioException For unknown resource - */ - public function __call($name, $arguments) { - $method = 'context' . ucfirst($name); - if (method_exists($this, $method)) { - return call_user_func_array(array($this, $method), $arguments); - } - - throw new TwilioException('Unknown context ' . $name); - } - - /** - * @return \Twilio\Rest\Preview\Wireless\CommandList - */ - protected function getCommands() { - return $this->wireless->commands; - } - - /** - * @param string $sid The sid - * @return \Twilio\Rest\Preview\Wireless\CommandContext - */ - protected function contextCommands($sid) { - return $this->wireless->commands($sid); - } - - /** - * @return \Twilio\Rest\Preview\Wireless\DeviceList - */ - protected function getDevices() { - return $this->wireless->devices; - } - - /** - * @param string $sid The sid - * @return \Twilio\Rest\Preview\Wireless\DeviceContext - */ - protected function contextDevices($sid) { - return $this->wireless->devices($sid); - } - - /** - * @return \Twilio\Rest\Preview\Wireless\RatePlanList - */ - protected function getRatePlans() { - return $this->wireless->ratePlans; - } - - /** - * @param string $sid The sid - * @return \Twilio\Rest\Preview\Wireless\RatePlanContext - */ - protected function contextRatePlans($sid) { - return $this->wireless->ratePlans($sid); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - return '[Twilio.Preview]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Preview/Wireless.php b/Twilio/Rest/Preview/Wireless.php deleted file mode 100644 index 9e85b64..0000000 --- a/Twilio/Rest/Preview/Wireless.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Preview; - -use Twilio\Domain; -use Twilio\Exceptions\TwilioException; -use Twilio\Rest\Preview\Wireless\CommandList; -use Twilio\Rest\Preview\Wireless\DeviceList; -use Twilio\Rest\Preview\Wireless\RatePlanList; -use Twilio\Version; - -/** - * @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 Wireless extends Version { - protected $_commands = null; - protected $_devices = null; - protected $_ratePlans = null; - - /** - * Construct the Wireless version of Preview - * - * @param \Twilio\Domain $domain Domain that contains the version - * @return \Twilio\Rest\Preview\Wireless Wireless version of Preview - */ - public function __construct(Domain $domain) { - parent::__construct($domain); - $this->version = 'wireless'; - } - - /** - * @return \Twilio\Rest\Preview\Wireless\CommandList - */ - protected function getCommands() { - if (!$this->_commands) { - $this->_commands = new CommandList($this); - } - 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; - } - - /** - * Magic getter to lazy load root resources - * - * @param string $name Resource to return - * @return \Twilio\ListResource The requested resource - * @throws \Twilio\Exceptions\TwilioException For unknown resource - */ - public function __get($name) { - $method = 'get' . ucfirst($name); - if (method_exists($this, $method)) { - return $this->$method(); - } - - throw new TwilioException('Unknown resource ' . $name); - } - - /** - * Magic caller to get resource contexts - * - * @param string $name Resource to return - * @param array $arguments Context parameters - * @return \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.Preview.Wireless]'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Preview/Wireless/CommandContext.php b/Twilio/Rest/Preview/Wireless/CommandContext.php deleted file mode 100644 index 4ff3b26..0000000 --- a/Twilio/Rest/Preview/Wireless/CommandContext.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Preview\Wireless; - -use Twilio\InstanceContext; -use Twilio\Values; -use Twilio\Version; - -class CommandContext extends InstanceContext { - /** - * Initialize the CommandContext - * - * @param \Twilio\Version $version Version that contains the resource - * @param string $sid The sid - * @return \Twilio\Rest\Preview\Wireless\CommandContext - */ - public function __construct(Version $version, $sid) { - parent::__construct($version); - - // Path Solution - $this->solution = array( - 'sid' => $sid, - ); - - $this->uri = '/Commands/' . $sid . ''; - } - - /** - * Fetch a CommandInstance - * - * @return CommandInstance Fetched CommandInstance - */ - public function fetch() { - $params = Values::of(array()); - - $payload = $this->version->fetch( - 'GET', - $this->uri, - $params - ); - - return new CommandInstance( - $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.CommandContext ' . implode(' ', $context) . ']'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Preview/Wireless/CommandInstance.php b/Twilio/Rest/Preview/Wireless/CommandInstance.php deleted file mode 100644 index 597347a..0000000 --- a/Twilio/Rest/Preview/Wireless/CommandInstance.php +++ /dev/null @@ -1,117 +0,0 @@ -<?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 accountSid - * @property string deviceSid - * @property string command - * @property string status - * @property string direction - * @property \DateTime dateCreated - * @property \DateTime dateUpdated - * @property string url - */ -class CommandInstance extends InstanceResource { - /** - * 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\Preview\Wireless\CommandInstance - */ - public function __construct(Version $version, array $payload, $sid = null) { - parent::__construct($version); - - // Marshaled Properties - $this->properties = array( - 'sid' => $payload['sid'], - 'accountSid' => $payload['account_sid'], - 'deviceSid' => $payload['device_sid'], - 'command' => $payload['command'], - 'status' => $payload['status'], - 'direction' => $payload['direction'], - '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\Preview\Wireless\CommandContext Context for this - * CommandInstance - */ - protected function proxy() { - if (!$this->context) { - $this->context = new CommandContext( - $this->version, - $this->solution['sid'] - ); - } - - return $this->context; - } - - /** - * Fetch a CommandInstance - * - * @return CommandInstance Fetched CommandInstance - */ - public function fetch() { - return $this->proxy()->fetch(); - } - - /** - * 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.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 deleted file mode 100644 index de60d86..0000000 --- a/Twilio/Rest/Preview/Wireless/CommandList.php +++ /dev/null @@ -1,161 +0,0 @@ -<?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), false); - } - - /** - * 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/Preview/Wireless/CommandPage.php b/Twilio/Rest/Preview/Wireless/CommandPage.php deleted file mode 100644 index b7e8b3d..0000000 --- a/Twilio/Rest/Preview/Wireless/CommandPage.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Preview\Wireless; - -use Twilio\Page; - -class CommandPage extends Page { - public function __construct($version, $response, $solution) { - parent::__construct($version, $response); - - // Path Solution - $this->solution = $solution; - } - - public function buildInstance(array $payload) { - return new CommandInstance( - $this->version, - $payload - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - 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 deleted file mode 100644 index 14928f1..0000000 --- a/Twilio/Rest/Preview/Wireless/Device/UsageContext.php +++ /dev/null @@ -1,74 +0,0 @@ -<?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 deleted file mode 100644 index 25ebf1f..0000000 --- a/Twilio/Rest/Preview/Wireless/Device/UsageInstance.php +++ /dev/null @@ -1,119 +0,0 @@ -<?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 deleted file mode 100644 index 59d25e6..0000000 --- a/Twilio/Rest/Preview/Wireless/Device/UsageList.php +++ /dev/null @@ -1,52 +0,0 @@ -<?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 deleted file mode 100644 index d35524f..0000000 --- a/Twilio/Rest/Preview/Wireless/Device/UsagePage.php +++ /dev/null @@ -1,38 +0,0 @@ -<?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/Preview/Wireless/DeviceContext.php b/Twilio/Rest/Preview/Wireless/DeviceContext.php deleted file mode 100644 index 8509d72..0000000 --- a/Twilio/Rest/Preview/Wireless/DeviceContext.php +++ /dev/null @@ -1,159 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Preview\Wireless; - -use Twilio\Exceptions\TwilioException; -use Twilio\InstanceContext; -use Twilio\Rest\Preview\Wireless\Device\UsageList; -use Twilio\Values; -use Twilio\Version; - -/** - * @property \Twilio\Rest\Preview\Wireless\Device\UsageList usage - * @method \Twilio\Rest\Preview\Wireless\Device\UsageContext usage() - */ -class DeviceContext extends InstanceContext { - protected $_usage = null; - - /** - * Initialize the DeviceContext - * - * @param \Twilio\Version $version Version that contains the resource - * @param string $sid The sid - * @return \Twilio\Rest\Preview\Wireless\DeviceContext - */ - public function __construct(Version $version, $sid) { - parent::__construct($version); - - // Path Solution - $this->solution = array( - 'sid' => $sid, - ); - - $this->uri = '/Devices/' . $sid . ''; - } - - /** - * Fetch a DeviceInstance - * - * @return DeviceInstance Fetched DeviceInstance - */ - public function fetch() { - $params = Values::of(array()); - - $payload = $this->version->fetch( - 'GET', - $this->uri, - $params - ); - - return new DeviceInstance( - $this->version, - $payload, - $this->solution['sid'] - ); - } - - /** - * Update the DeviceInstance - * - * @param array $options Optional Arguments - * @return DeviceInstance Updated DeviceInstance - */ - 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->_usage; - } - - /** - * 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() { - $context = array(); - foreach ($this->solution as $key => $value) { - $context[] = "$key=$value"; - } - 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 deleted file mode 100644 index 79257c2..0000000 --- a/Twilio/Rest/Preview/Wireless/DeviceInstance.php +++ /dev/null @@ -1,148 +0,0 @@ -<?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 deleted file mode 100644 index 960bcbf..0000000 --- a/Twilio/Rest/Preview/Wireless/DeviceList.php +++ /dev/null @@ -1,165 +0,0 @@ -<?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), false); - } - - /** - * 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/Preview/Wireless/DevicePage.php b/Twilio/Rest/Preview/Wireless/DevicePage.php deleted file mode 100644 index fb04329..0000000 --- a/Twilio/Rest/Preview/Wireless/DevicePage.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Preview\Wireless; - -use Twilio\Page; - -class DevicePage extends Page { - public function __construct($version, $response, $solution) { - parent::__construct($version, $response); - - // Path Solution - $this->solution = $solution; - } - - public function buildInstance(array $payload) { - return new DeviceInstance( - $this->version, - $payload - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - 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 deleted file mode 100644 index 30c6aa4..0000000 --- a/Twilio/Rest/Preview/Wireless/RatePlanContext.php +++ /dev/null @@ -1,68 +0,0 @@ -<?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/Preview/Wireless/RatePlanInstance.php b/Twilio/Rest/Preview/Wireless/RatePlanInstance.php deleted file mode 100644 index d5212b8..0000000 --- a/Twilio/Rest/Preview/Wireless/RatePlanInstance.php +++ /dev/null @@ -1,129 +0,0 @@ -<?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 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 RatePlanInstance extends InstanceResource { - /** - * Initialize the RatePlanInstance - * - * @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\RatePlanInstance - */ - 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'], - '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( - 'sid' => $sid ?: $this->properties['sid'], - ); - } - - /** - * 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\RatePlanContext Context for this - * RatePlanInstance - */ - protected function proxy() { - if (!$this->context) { - $this->context = new RatePlanContext( - $this->version, - $this->solution['sid'] - ); - } - - return $this->context; - } - - /** - * Fetch a RatePlanInstance - * - * @return RatePlanInstance Fetched RatePlanInstance - */ - public function fetch() { - return $this->proxy()->fetch(); - } - - /** - * 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.RatePlanInstance ' . implode(' ', $context) . ']'; - } -}
\ No newline at end of file diff --git a/Twilio/Rest/Preview/Wireless/RatePlanList.php b/Twilio/Rest/Preview/Wireless/RatePlanList.php deleted file mode 100644 index 6017b7d..0000000 --- a/Twilio/Rest/Preview/Wireless/RatePlanList.php +++ /dev/null @@ -1,123 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Rest\Preview\Wireless; - -use Twilio\ListResource; -use Twilio\Values; -use Twilio\Version; - -class RatePlanList extends ListResource { - /** - * Construct the RatePlanList - * - * @param Version $version Version that contains the resource - * @return \Twilio\Rest\Preview\Wireless\RatePlanList - */ - public function __construct(Version $version) { - parent::__construct($version); - - // Path Solution - $this->solution = array(); - - $this->uri = '/RatePlans'; - } - - /** - * Streams RatePlanInstance records from the API as a generator stream. - * This operation lazily loads records as efficiently as possible until the - * limit - * is reached. - * The results are returned as a generator, so this operation is memory - * efficient. - * - * @param int $limit Upper limit for the number of records to return. stream() - * guarantees to never return more than limit. Default is no - * limit - * @param mixed $pageSize Number of records to fetch per request, when not set - * will use the default value of 50 records. If no - * page_size is defined but a limit is defined, stream() - * will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - * @return \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 RatePlanInstance records from the API as a list. - * Unlike stream(), this operation is eager and will load `limit` records into - * memory before returning. - * - * @param int $limit Upper limit for the number of records to return. read() - * guarantees to never return more than limit. Default is no - * limit - * @param mixed $pageSize Number of records to fetch per request, when not set - * will use the default value of 50 records. If no - * page_size is defined but a limit is defined, read() - * will attempt to read the limit with the most - * efficient page size, i.e. min(limit, 1000) - * @return RatePlanInstance[] Array of results - */ - public function read($limit = null, $pageSize = Values::NONE) { - return iterator_to_array($this->stream($limit, $pageSize), false); - } - - /** - * Retrieve a single page of RatePlanInstance records from the API. - * Request is executed immediately - * - * @param mixed $pageSize Number of records to return, defaults to 50 - * @param string $pageToken PageToken provided by the API - * @param mixed $pageNumber Page Number, this value is simply for client state - * @return \Twilio\Page Page of RatePlanInstance - */ - 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 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 - ); - } - - /** - * Provide a friendly representation - * - * @return string Machine friendly representation - */ - public function __toString() { - 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 deleted file mode 100644 index ceb2fcc..0000000 --- a/Twilio/Rest/Preview/Wireless/RatePlanPage.php +++ /dev/null @@ -1,37 +0,0 @@ -<?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/Tests/Integration/Notifications/V1/CredentialTest.php b/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php deleted file mode 100644 index 4ec955d..0000000 --- a/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php +++ /dev/null @@ -1,230 +0,0 @@ -<?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("gcm"); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $values = array( - '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("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(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'post', - 'https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - 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(); - - $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 deleted file mode 100644 index 99c797c..0000000 --- a/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php +++ /dev/null @@ -1,218 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Tests\Integration\Notifications\V1\Service; - -use Twilio\Exceptions\DeserializeException; -use Twilio\Exceptions\TwilioException; -use Twilio\Http\Response; -use Twilio\Tests\HolodeckTestCase; -use Twilio\Tests\Request; - -class BindingTest extends HolodeckTestCase { - public function testFetchRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - public function testFetchResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2016-03-24T23:24:45Z", - "date_updated": "2016-03-24T23:24:45Z", - "notification_protocol_version": "3", - "endpoint": "abcd", - "identity": "jing", - "binding_type": "apn", - "address": "1234", - "tags": [], - "url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ' - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - - $this->assertNotNull($actual); - } - - public function testDeleteRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'delete', - 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - public function testDeleteResponse() { - $this->holodeck->mock(new Response( - 204, - null - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); - - $this->assertTrue($actual); - } - - public function testCreateRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings->create("endpoint", "identity", "apn", "address"); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $values = array( - 'Endpoint' => "endpoint", - 'Identity' => "identity", - 'BindingType' => "apn", - 'Address' => "address", - ); - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'post', - 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings', - null, - $values - ))); - } - - public function testCreateResponse() { - $this->holodeck->mock(new Response( - 201, - ' - { - "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2016-03-24T23:24:45Z", - "date_updated": "2016-03-24T23:24:45Z", - "notification_protocol_version": "3", - "endpoint": "abcd", - "identity": "jing", - "binding_type": "apn", - "address": "1234", - "tags": [], - "url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ' - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings->create("endpoint", "identity", "apn", "address"); - - $this->assertNotNull($actual); - } - - public function testReadRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings->read(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' - ))); - } - - public function testReadFullResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "meta": { - "page": 0, - "page_size": 1, - "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": null, - "key": "bindings" - }, - "bindings": [ - { - "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2016-03-24T23:24:45Z", - "date_updated": "2016-03-24T23:24:45Z", - "notification_protocol_version": "3", - "endpoint": "abcd", - "identity": "jing", - "binding_type": "apn", - "address": "1234", - "tags": [], - "url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ] - } - ' - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings->read(); - - $this->assertTrue(count($actual) > 0); - } - - public function testReadEmptyResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "meta": { - "page": 0, - "page_size": 1, - "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": null, - "key": "bindings" - }, - "bindings": [] - } - ' - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->bindings->read(); - - $this->assertNotNull($actual); - } -}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php b/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php deleted file mode 100644 index 0b1e7cd..0000000 --- a/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Tests\Integration\Notifications\V1\Service; - -use Twilio\Exceptions\DeserializeException; -use Twilio\Exceptions\TwilioException; -use Twilio\Http\Response; -use Twilio\Tests\HolodeckTestCase; -use Twilio\Tests\Request; - -class NotificationTest extends HolodeckTestCase { - public function testCreateRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->notifications->create(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'post', - 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications' - ))); - } - - public function testCreateResponse() { - $this->holodeck->mock(new Response( - 201, - ' - { - "sid": "NOb8021351170b4e1286adaac3fdd6d082", - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "service_sid": "IS699b53e02da45a1ba9d13b7d7d2766af", - "date_created": "2016-03-24T23:42:28Z", - "identities": [ - "jing" - ], - "tags": [], - "priority": "high", - "ttl": 2419200, - "title": "test", - "body": "body", - "sound": null, - "action": null, - "data": null, - "apn": null, - "gcm": null, - "sms": null, - "facebook_messenger": null - } - ' - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->notifications->create(); - - $this->assertNotNull($actual); - } -}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php b/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php deleted file mode 100644 index ae9205f..0000000 --- a/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php +++ /dev/null @@ -1,256 +0,0 @@ -<?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 ServiceTest extends HolodeckTestCase { - public function testCreateRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services->create(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'post', - 'https://notifications.twilio.com/v1/Services' - ))); - } - - public function testCreateResponse() { - $this->holodeck->mock(new Response( - 201, - ' - { - "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c", - "date_created": "2016-03-09T20:22:31Z", - "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", - "links": { - "bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", - "notifications": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications" - } - } - ' - )); - - $actual = $this->twilio->notifications->v1->services->create(); - - $this->assertNotNull($actual); - } - - public function testDeleteRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'delete', - 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - public function testDeleteResponse() { - $this->holodeck->mock(new Response( - 204, - null - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); - - $this->assertTrue($actual); - } - - public function testFetchRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - public function testFetchResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c", - "date_created": "2016-03-09T20:22:31Z", - "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", - "links": { - "bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", - "notifications": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications" - } - } - ' - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - - $this->assertNotNull($actual); - } - - public function testReadRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services->read(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://notifications.twilio.com/v1/Services' - ))); - } - - public function testReadFullResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "meta": { - "page": 0, - "page_size": 1, - "first_page_url": "https://notifications.twilio.com/v1/Services?PageSize=1&Page=0", - "previous_page_url": null, - "url": "https://notifications.twilio.com/v1/Services?PageSize=1&Page=0", - "next_page_url": null, - "key": "services" - }, - "services": [ - { - "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c", - "date_created": "2016-03-09T20:22:31Z", - "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", - "links": { - "bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", - "notifications": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications" - } - } - ] - } - ' - )); - - $actual = $this->twilio->notifications->v1->services->read(); - - $this->assertTrue(count($actual) > 0); - } - - public function testReadEmptyResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "meta": { - "page": 0, - "page_size": 50, - "first_page_url": "https://notifications.twilio.com/v1/Services?PageSize=50&Page=0", - "previous_page_url": null, - "url": "https://notifications.twilio.com/v1/Services?PageSize=50&Page=0", - "next_page_url": null, - "key": "services" - }, - "services": [] - } - ' - )); - - $actual = $this->twilio->notifications->v1->services->read(); - - $this->assertNotNull($actual); - } - - public function testUpdateRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'post', - 'https://notifications.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - public function testUpdateResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c", - "date_created": "2016-03-09T20:22:31Z", - "date_updated": "2016-03-09T20:22:31Z", - "apn_credential_sid": null, - "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", - "notifications": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications" - } - } - ' - )); - - $actual = $this->twilio->notifications->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); - - $this->assertNotNull($actual); - } -}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php b/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php deleted file mode 100644 index 260c95d..0000000 --- a/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php +++ /dev/null @@ -1,67 +0,0 @@ -<?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 deleted file mode 100644 index 60975ca..0000000 --- a/Twilio/Tests/Integration/Preview/Wireless/Device/UsageTest.php +++ /dev/null @@ -1,33 +0,0 @@ -<?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("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->usage()->fetch(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://preview.twilio.com/wireless/Devices/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/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 deleted file mode 100644 index 2be4508..0000000 --- a/Twilio/Tests/Integration/Preview/Wireless/DeviceTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?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("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://preview.twilio.com/wireless/Devices/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - 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("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'post', - 'https://preview.twilio.com/wireless/Devices/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } -}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php b/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php deleted file mode 100644 index 4d9fc5d..0000000 --- a/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php +++ /dev/null @@ -1,46 +0,0 @@ -<?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 |