summaryrefslogtreecommitdiffstats
path: root/Twilio/Rest/Notifications
diff options
context:
space:
mode:
Diffstat (limited to 'Twilio/Rest/Notifications')
-rw-r--r--Twilio/Rest/Notifications/V1.php100
-rw-r--r--Twilio/Rest/Notifications/V1/CredentialContext.php108
-rw-r--r--Twilio/Rest/Notifications/V1/CredentialInstance.php136
-rw-r--r--Twilio/Rest/Notifications/V1/CredentialList.php155
-rw-r--r--Twilio/Rest/Notifications/V1/CredentialPage.php37
-rw-r--r--Twilio/Rest/Notifications/V1/Service/BindingContext.php80
-rw-r--r--Twilio/Rest/Notifications/V1/Service/BindingInstance.php136
-rw-r--r--Twilio/Rest/Notifications/V1/Service/BindingList.php175
-rw-r--r--Twilio/Rest/Notifications/V1/Service/BindingPage.php38
-rw-r--r--Twilio/Rest/Notifications/V1/Service/NotificationInstance.php102
-rw-r--r--Twilio/Rest/Notifications/V1/Service/NotificationList.php82
-rw-r--r--Twilio/Rest/Notifications/V1/Service/NotificationPage.php38
-rw-r--r--Twilio/Rest/Notifications/V1/ServiceContext.php186
-rw-r--r--Twilio/Rest/Notifications/V1/ServiceInstance.php167
-rw-r--r--Twilio/Rest/Notifications/V1/ServiceList.php160
-rw-r--r--Twilio/Rest/Notifications/V1/ServicePage.php37
16 files changed, 0 insertions, 1737 deletions
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