Subiendo proyecto completo sin restricciones de git ignore

This commit is contained in:
Jose Sanchez
2023-08-17 11:44:02 -04:00
parent a0d4f5ba3b
commit 20f1c60600
19921 changed files with 2509159 additions and 45 deletions

View File

@@ -0,0 +1,93 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content;
use Twilio\Domain;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceContext;
use Twilio\Rest\Content\V1\ContentList;
use Twilio\Rest\Content\V1\LegacyContentList;
use Twilio\Version;
/**
* @property ContentList $contents
* @property LegacyContentList $legacyContents
* @method \Twilio\Rest\Content\V1\ContentContext contents(string $sid)
*/
class V1 extends Version {
protected $_contents;
protected $_legacyContents;
/**
* Construct the V1 version of Content
*
* @param Domain $domain Domain that contains the version
*/
public function __construct(Domain $domain) {
parent::__construct($domain);
$this->version = 'v1';
}
protected function getContents(): ContentList {
if (!$this->_contents) {
$this->_contents = new ContentList($this);
}
return $this->_contents;
}
protected function getLegacyContents(): LegacyContentList {
if (!$this->_legacyContents) {
$this->_legacyContents = new LegacyContentList($this);
}
return $this->_legacyContents;
}
/**
* Magic getter to lazy load root resources
*
* @param string $name Resource to return
* @return \Twilio\ListResource The requested resource
* @throws TwilioException For unknown resource
*/
public function __get(string $name) {
$method = 'get' . \ucfirst($name);
if (\method_exists($this, $method)) {
return $this->$method();
}
throw new TwilioException('Unknown resource ' . $name);
}
/**
* Magic caller to get resource contexts
*
* @param string $name Resource to return
* @param array $arguments Context parameters
* @return InstanceContext The requested resource context
* @throws TwilioException For unknown resource
*/
public function __call(string $name, array $arguments): InstanceContext {
$property = $this->$name;
if (\method_exists($property, 'getContext')) {
return \call_user_func_array(array($property, 'getContext'), $arguments);
}
throw new TwilioException('Resource does not have a context');
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Content.V1]';
}
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1\Content;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceContext;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*/
class ApprovalFetchContext extends InstanceContext {
/**
* Initialize the ApprovalFetchContext
*
* @param Version $version Version that contains the resource
* @param string $sid The unique string that identifies the Content resource
*/
public function __construct(Version $version, $sid) {
parent::__construct($version);
// Path Solution
$this->solution = ['sid' => $sid, ];
$this->uri = '/Content/' . \rawurlencode($sid) . '/ApprovalRequests';
}
/**
* Fetch the ApprovalFetchInstance
*
* @return ApprovalFetchInstance Fetched ApprovalFetchInstance
* @throws TwilioException When an HTTP error occurs.
*/
public function fetch(): ApprovalFetchInstance {
$payload = $this->version->fetch('GET', $this->uri);
return new ApprovalFetchInstance($this->version, $payload, $this->solution['sid']);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
$context = [];
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Content.V1.ApprovalFetchContext ' . \implode(' ', $context) . ']';
}
}

View File

@@ -0,0 +1,103 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1\Content;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceResource;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*
* @property string $sid
* @property string $accountSid
* @property array $whatsapp
* @property string $url
*/
class ApprovalFetchInstance extends InstanceResource {
/**
* Initialize the ApprovalFetchInstance
*
* @param Version $version Version that contains the resource
* @param mixed[] $payload The response payload
* @param string $sid The unique string that identifies the Content resource
*/
public function __construct(Version $version, array $payload, string $sid) {
parent::__construct($version);
// Marshaled Properties
$this->properties = [
'sid' => Values::array_get($payload, 'sid'),
'accountSid' => Values::array_get($payload, 'account_sid'),
'whatsapp' => Values::array_get($payload, 'whatsapp'),
'url' => Values::array_get($payload, 'url'),
];
$this->solution = ['sid' => $sid, ];
}
/**
* Generate an instance context for the instance, the context is capable of
* performing various actions. All instance actions are proxied to the context
*
* @return ApprovalFetchContext Context for this ApprovalFetchInstance
*/
protected function proxy(): ApprovalFetchContext {
if (!$this->context) {
$this->context = new ApprovalFetchContext($this->version, $this->solution['sid']);
}
return $this->context;
}
/**
* Fetch the ApprovalFetchInstance
*
* @return ApprovalFetchInstance Fetched ApprovalFetchInstance
* @throws TwilioException When an HTTP error occurs.
*/
public function fetch(): ApprovalFetchInstance {
return $this->proxy()->fetch();
}
/**
* Magic getter to access properties
*
* @param string $name Property to access
* @return mixed The requested property
* @throws TwilioException For unknown properties
*/
public function __get(string $name) {
if (\array_key_exists($name, $this->properties)) {
return $this->properties[$name];
}
if (\property_exists($this, '_' . $name)) {
$method = 'get' . \ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown property: ' . $name);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
$context = [];
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Content.V1.ApprovalFetchInstance ' . \implode(' ', $context) . ']';
}
}

View File

@@ -0,0 +1,47 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1\Content;
use Twilio\ListResource;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*/
class ApprovalFetchList extends ListResource {
/**
* Construct the ApprovalFetchList
*
* @param Version $version Version that contains the resource
* @param string $sid The unique string that identifies the Content resource
*/
public function __construct(Version $version, string $sid) {
parent::__construct($version);
// Path Solution
$this->solution = ['sid' => $sid, ];
}
/**
* Constructs a ApprovalFetchContext
*/
public function getContext(): ApprovalFetchContext {
return new ApprovalFetchContext($this->version, $this->solution['sid']);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Content.V1.ApprovalFetchList]';
}
}

View File

@@ -0,0 +1,48 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1\Content;
use Twilio\Http\Response;
use Twilio\Page;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*/
class ApprovalFetchPage extends Page {
/**
* @param Version $version Version that contains the resource
* @param Response $response Response from the API
* @param array $solution The context solution
*/
public function __construct(Version $version, Response $response, array $solution) {
parent::__construct($version, $response);
// Path Solution
$this->solution = $solution;
}
/**
* @param array $payload Payload response from the API
* @return ApprovalFetchInstance \Twilio\Rest\Content\V1\Content\ApprovalFetchInstance
*/
public function buildInstance(array $payload): ApprovalFetchInstance {
return new ApprovalFetchInstance($this->version, $payload, $this->solution['sid']);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Content.V1.ApprovalFetchPage]';
}
}

View File

@@ -0,0 +1,121 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceContext;
use Twilio\ListResource;
use Twilio\Rest\Content\V1\Content\ApprovalFetchList;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*
* @property ApprovalFetchList $approvalFetch
* @method \Twilio\Rest\Content\V1\Content\ApprovalFetchContext approvalFetch()
*/
class ContentContext extends InstanceContext {
protected $_approvalFetch;
/**
* Initialize the ContentContext
*
* @param Version $version Version that contains the resource
* @param string $sid The unique string that identifies the resource
*/
public function __construct(Version $version, $sid) {
parent::__construct($version);
// Path Solution
$this->solution = ['sid' => $sid, ];
$this->uri = '/Content/' . \rawurlencode($sid) . '';
}
/**
* Fetch the ContentInstance
*
* @return ContentInstance Fetched ContentInstance
* @throws TwilioException When an HTTP error occurs.
*/
public function fetch(): ContentInstance {
$payload = $this->version->fetch('GET', $this->uri);
return new ContentInstance($this->version, $payload, $this->solution['sid']);
}
/**
* Delete the ContentInstance
*
* @return bool True if delete succeeds, false otherwise
* @throws TwilioException When an HTTP error occurs.
*/
public function delete(): bool {
return $this->version->delete('DELETE', $this->uri);
}
/**
* Access the approvalFetch
*/
protected function getApprovalFetch(): ApprovalFetchList {
if (!$this->_approvalFetch) {
$this->_approvalFetch = new ApprovalFetchList($this->version, $this->solution['sid']);
}
return $this->_approvalFetch;
}
/**
* Magic getter to lazy load subresources
*
* @param string $name Subresource to return
* @return ListResource The requested subresource
* @throws TwilioException For unknown subresources
*/
public function __get(string $name): ListResource {
if (\property_exists($this, '_' . $name)) {
$method = 'get' . \ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown subresource ' . $name);
}
/**
* Magic caller to get resource contexts
*
* @param string $name Resource to return
* @param array $arguments Context parameters
* @return InstanceContext The requested resource context
* @throws TwilioException For unknown resource
*/
public function __call(string $name, array $arguments): InstanceContext {
$property = $this->$name;
if (\method_exists($property, 'getContext')) {
return \call_user_func_array(array($property, 'getContext'), $arguments);
}
throw new TwilioException('Resource does not have a context');
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
$context = [];
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Content.V1.ContentContext ' . \implode(' ', $context) . ']';
}
}

View File

@@ -0,0 +1,136 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1;
use Twilio\Deserialize;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceResource;
use Twilio\Rest\Content\V1\Content\ApprovalFetchList;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*
* @property \DateTime $dateCreated
* @property \DateTime $dateUpdated
* @property string $sid
* @property string $accountSid
* @property string $friendlyName
* @property string $language
* @property array $variables
* @property array $types
* @property string $url
* @property array $links
*/
class ContentInstance extends InstanceResource {
protected $_approvalFetch;
/**
* Initialize the ContentInstance
*
* @param Version $version Version that contains the resource
* @param mixed[] $payload The response payload
* @param string $sid The unique string that identifies the resource
*/
public function __construct(Version $version, array $payload, string $sid = null) {
parent::__construct($version);
// Marshaled Properties
$this->properties = [
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
'sid' => Values::array_get($payload, 'sid'),
'accountSid' => Values::array_get($payload, 'account_sid'),
'friendlyName' => Values::array_get($payload, 'friendly_name'),
'language' => Values::array_get($payload, 'language'),
'variables' => Values::array_get($payload, 'variables'),
'types' => Values::array_get($payload, 'types'),
'url' => Values::array_get($payload, 'url'),
'links' => Values::array_get($payload, 'links'),
];
$this->solution = ['sid' => $sid ?: $this->properties['sid'], ];
}
/**
* Generate an instance context for the instance, the context is capable of
* performing various actions. All instance actions are proxied to the context
*
* @return ContentContext Context for this ContentInstance
*/
protected function proxy(): ContentContext {
if (!$this->context) {
$this->context = new ContentContext($this->version, $this->solution['sid']);
}
return $this->context;
}
/**
* Fetch the ContentInstance
*
* @return ContentInstance Fetched ContentInstance
* @throws TwilioException When an HTTP error occurs.
*/
public function fetch(): ContentInstance {
return $this->proxy()->fetch();
}
/**
* Delete the ContentInstance
*
* @return bool True if delete succeeds, false otherwise
* @throws TwilioException When an HTTP error occurs.
*/
public function delete(): bool {
return $this->proxy()->delete();
}
/**
* Access the approvalFetch
*/
protected function getApprovalFetch(): ApprovalFetchList {
return $this->proxy()->approvalFetch;
}
/**
* Magic getter to access properties
*
* @param string $name Property to access
* @return mixed The requested property
* @throws TwilioException For unknown properties
*/
public function __get(string $name) {
if (\array_key_exists($name, $this->properties)) {
return $this->properties[$name];
}
if (\property_exists($this, '_' . $name)) {
$method = 'get' . \ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown property: ' . $name);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
$context = [];
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Twilio.Content.V1.ContentInstance ' . \implode(' ', $context) . ']';
}
}

View File

@@ -0,0 +1,130 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1;
use Twilio\ListResource;
use Twilio\Stream;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*/
class ContentList extends ListResource {
/**
* Construct the ContentList
*
* @param Version $version Version that contains the resource
*/
public function __construct(Version $version) {
parent::__construct($version);
// Path Solution
$this->solution = [];
$this->uri = '/Content';
}
/**
* Streams ContentInstance records from the API as a generator stream.
* This operation lazily loads records as efficiently as possible until the
* limit
* is reached.
* The results are returned as a generator, so this operation is memory
* efficient.
*
* @param int $limit Upper limit for the number of records to return. stream()
* guarantees to never return more than limit. Default is no
* limit
* @param mixed $pageSize Number of records to fetch per request, when not set
* will use the default value of 50 records. If no
* page_size is defined but a limit is defined, stream()
* will attempt to read the limit with the most
* efficient page size, i.e. min(limit, 1000)
* @return Stream stream of results
*/
public function stream(int $limit = null, $pageSize = null): Stream {
$limits = $this->version->readLimits($limit, $pageSize);
$page = $this->page($limits['pageSize']);
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
}
/**
* Reads ContentInstance records from the API as a list.
* Unlike stream(), this operation is eager and will load `limit` records into
* memory before returning.
*
* @param int $limit Upper limit for the number of records to return. read()
* guarantees to never return more than limit. Default is no
* limit
* @param mixed $pageSize Number of records to fetch per request, when not set
* will use the default value of 50 records. If no
* page_size is defined but a limit is defined, read()
* will attempt to read the limit with the most
* efficient page size, i.e. min(limit, 1000)
* @return ContentInstance[] Array of results
*/
public function read(int $limit = null, $pageSize = null): array {
return \iterator_to_array($this->stream($limit, $pageSize), false);
}
/**
* Retrieve a single page of ContentInstance records from the API.
* Request is executed immediately
*
* @param mixed $pageSize Number of records to return, defaults to 50
* @param string $pageToken PageToken provided by the API
* @param mixed $pageNumber Page Number, this value is simply for client state
* @return ContentPage Page of ContentInstance
*/
public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): ContentPage {
$params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]);
$response = $this->version->page('GET', $this->uri, $params);
return new ContentPage($this->version, $response, $this->solution);
}
/**
* Retrieve a specific page of ContentInstance records from the API.
* Request is executed immediately
*
* @param string $targetUrl API-generated URL for the requested results page
* @return ContentPage Page of ContentInstance
*/
public function getPage(string $targetUrl): ContentPage {
$response = $this->version->getDomain()->getClient()->request(
'GET',
$targetUrl
);
return new ContentPage($this->version, $response, $this->solution);
}
/**
* Constructs a ContentContext
*
* @param string $sid The unique string that identifies the resource
*/
public function getContext(string $sid): ContentContext {
return new ContentContext($this->version, $sid);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Content.V1.ContentList]';
}
}

View File

@@ -0,0 +1,48 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1;
use Twilio\Http\Response;
use Twilio\Page;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*/
class ContentPage extends Page {
/**
* @param Version $version Version that contains the resource
* @param Response $response Response from the API
* @param array $solution The context solution
*/
public function __construct(Version $version, Response $response, array $solution) {
parent::__construct($version, $response);
// Path Solution
$this->solution = $solution;
}
/**
* @param array $payload Payload response from the API
* @return ContentInstance \Twilio\Rest\Content\V1\ContentInstance
*/
public function buildInstance(array $payload): ContentInstance {
return new ContentInstance($this->version, $payload);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Content.V1.ContentPage]';
}
}

View File

@@ -0,0 +1,89 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1;
use Twilio\Deserialize;
use Twilio\Exceptions\TwilioException;
use Twilio\InstanceResource;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*
* @property \DateTime $dateCreated
* @property \DateTime $dateUpdated
* @property string $sid
* @property string $accountSid
* @property string $friendlyName
* @property string $language
* @property array $variables
* @property array $types
* @property string $legacyTemplateName
* @property string $legacyBody
* @property string $url
*/
class LegacyContentInstance extends InstanceResource {
/**
* Initialize the LegacyContentInstance
*
* @param Version $version Version that contains the resource
* @param mixed[] $payload The response payload
*/
public function __construct(Version $version, array $payload) {
parent::__construct($version);
// Marshaled Properties
$this->properties = [
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
'sid' => Values::array_get($payload, 'sid'),
'accountSid' => Values::array_get($payload, 'account_sid'),
'friendlyName' => Values::array_get($payload, 'friendly_name'),
'language' => Values::array_get($payload, 'language'),
'variables' => Values::array_get($payload, 'variables'),
'types' => Values::array_get($payload, 'types'),
'legacyTemplateName' => Values::array_get($payload, 'legacy_template_name'),
'legacyBody' => Values::array_get($payload, 'legacy_body'),
'url' => Values::array_get($payload, 'url'),
];
$this->solution = [];
}
/**
* Magic getter to access properties
*
* @param string $name Property to access
* @return mixed The requested property
* @throws TwilioException For unknown properties
*/
public function __get(string $name) {
if (\array_key_exists($name, $this->properties)) {
return $this->properties[$name];
}
if (\property_exists($this, '_' . $name)) {
$method = 'get' . \ucfirst($name);
return $this->$method();
}
throw new TwilioException('Unknown property: ' . $name);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Content.V1.LegacyContentInstance]';
}
}

View File

@@ -0,0 +1,121 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1;
use Twilio\ListResource;
use Twilio\Stream;
use Twilio\Values;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*/
class LegacyContentList extends ListResource {
/**
* Construct the LegacyContentList
*
* @param Version $version Version that contains the resource
*/
public function __construct(Version $version) {
parent::__construct($version);
// Path Solution
$this->solution = [];
$this->uri = '/LegacyContent';
}
/**
* Streams LegacyContentInstance records from the API as a generator stream.
* This operation lazily loads records as efficiently as possible until the
* limit
* is reached.
* The results are returned as a generator, so this operation is memory
* efficient.
*
* @param int $limit Upper limit for the number of records to return. stream()
* guarantees to never return more than limit. Default is no
* limit
* @param mixed $pageSize Number of records to fetch per request, when not set
* will use the default value of 50 records. If no
* page_size is defined but a limit is defined, stream()
* will attempt to read the limit with the most
* efficient page size, i.e. min(limit, 1000)
* @return Stream stream of results
*/
public function stream(int $limit = null, $pageSize = null): Stream {
$limits = $this->version->readLimits($limit, $pageSize);
$page = $this->page($limits['pageSize']);
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
}
/**
* Reads LegacyContentInstance records from the API as a list.
* Unlike stream(), this operation is eager and will load `limit` records into
* memory before returning.
*
* @param int $limit Upper limit for the number of records to return. read()
* guarantees to never return more than limit. Default is no
* limit
* @param mixed $pageSize Number of records to fetch per request, when not set
* will use the default value of 50 records. If no
* page_size is defined but a limit is defined, read()
* will attempt to read the limit with the most
* efficient page size, i.e. min(limit, 1000)
* @return LegacyContentInstance[] Array of results
*/
public function read(int $limit = null, $pageSize = null): array {
return \iterator_to_array($this->stream($limit, $pageSize), false);
}
/**
* Retrieve a single page of LegacyContentInstance records from the API.
* Request is executed immediately
*
* @param mixed $pageSize Number of records to return, defaults to 50
* @param string $pageToken PageToken provided by the API
* @param mixed $pageNumber Page Number, this value is simply for client state
* @return LegacyContentPage Page of LegacyContentInstance
*/
public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): LegacyContentPage {
$params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]);
$response = $this->version->page('GET', $this->uri, $params);
return new LegacyContentPage($this->version, $response, $this->solution);
}
/**
* Retrieve a specific page of LegacyContentInstance records from the API.
* Request is executed immediately
*
* @param string $targetUrl API-generated URL for the requested results page
* @return LegacyContentPage Page of LegacyContentInstance
*/
public function getPage(string $targetUrl): LegacyContentPage {
$response = $this->version->getDomain()->getClient()->request(
'GET',
$targetUrl
);
return new LegacyContentPage($this->version, $response, $this->solution);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Content.V1.LegacyContentList]';
}
}

View File

@@ -0,0 +1,48 @@
<?php
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
namespace Twilio\Rest\Content\V1;
use Twilio\Http\Response;
use Twilio\Page;
use Twilio\Version;
/**
* PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
*/
class LegacyContentPage extends Page {
/**
* @param Version $version Version that contains the resource
* @param Response $response Response from the API
* @param array $solution The context solution
*/
public function __construct(Version $version, Response $response, array $solution) {
parent::__construct($version, $response);
// Path Solution
$this->solution = $solution;
}
/**
* @param array $payload Payload response from the API
* @return LegacyContentInstance \Twilio\Rest\Content\V1\LegacyContentInstance
*/
public function buildInstance(array $payload): LegacyContentInstance {
return new LegacyContentInstance($this->version, $payload);
}
/**
* Provide a friendly representation
*
* @return string Machine friendly representation
*/
public function __toString(): string {
return '[Twilio.Content.V1.LegacyContentPage]';
}
}