Subiendo proyecto completo sin restricciones de git ignore
This commit is contained in:
109
vendor/twilio/sdk/src/Twilio/Rest/Accounts.php
vendored
Normal file
109
vendor/twilio/sdk/src/Twilio/Rest/Accounts.php
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest;
|
||||
|
||||
use Twilio\Domain;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\Rest\Accounts\V1;
|
||||
|
||||
/**
|
||||
* @property \Twilio\Rest\Accounts\V1 $v1
|
||||
* @property \Twilio\Rest\Accounts\V1\AuthTokenPromotionList $authTokenPromotion
|
||||
* @property \Twilio\Rest\Accounts\V1\CredentialList $credentials
|
||||
* @property \Twilio\Rest\Accounts\V1\SecondaryAuthTokenList $secondaryAuthToken
|
||||
* @method \Twilio\Rest\Accounts\V1\AuthTokenPromotionContext authTokenPromotion()
|
||||
* @method \Twilio\Rest\Accounts\V1\SecondaryAuthTokenContext secondaryAuthToken()
|
||||
*/
|
||||
class Accounts extends Domain {
|
||||
protected $_v1;
|
||||
|
||||
/**
|
||||
* Construct the Accounts Domain
|
||||
*
|
||||
* @param Client $client Client to communicate with Twilio
|
||||
*/
|
||||
public function __construct(Client $client) {
|
||||
parent::__construct($client);
|
||||
|
||||
$this->baseUrl = 'https://accounts.twilio.com';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return V1 Version v1 of accounts
|
||||
*/
|
||||
protected function getV1(): V1 {
|
||||
if (!$this->_v1) {
|
||||
$this->_v1 = new V1($this);
|
||||
}
|
||||
return $this->_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic getter to lazy load version
|
||||
*
|
||||
* @param string $name Version to return
|
||||
* @return \Twilio\Version The requested version
|
||||
* @throws TwilioException For unknown versions
|
||||
*/
|
||||
public function __get(string $name) {
|
||||
$method = 'get' . \ucfirst($name);
|
||||
if (\method_exists($this, $method)) {
|
||||
return $this->$method();
|
||||
}
|
||||
|
||||
throw new TwilioException('Unknown version ' . $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic caller to get resource contexts
|
||||
*
|
||||
* @param string $name Resource to return
|
||||
* @param array $arguments Context parameters
|
||||
* @return \Twilio\InstanceContext The requested resource context
|
||||
* @throws TwilioException For unknown resource
|
||||
*/
|
||||
public function __call(string $name, array $arguments) {
|
||||
$method = 'context' . \ucfirst($name);
|
||||
if (\method_exists($this, $method)) {
|
||||
return \call_user_func_array([$this, $method], $arguments);
|
||||
}
|
||||
|
||||
throw new TwilioException('Unknown context ' . $name);
|
||||
}
|
||||
|
||||
protected function getAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionList {
|
||||
return $this->v1->authTokenPromotion;
|
||||
}
|
||||
|
||||
protected function contextAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionContext {
|
||||
return $this->v1->authTokenPromotion();
|
||||
}
|
||||
|
||||
protected function getCredentials(): \Twilio\Rest\Accounts\V1\CredentialList {
|
||||
return $this->v1->credentials;
|
||||
}
|
||||
|
||||
protected function getSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenList {
|
||||
return $this->v1->secondaryAuthToken;
|
||||
}
|
||||
|
||||
protected function contextSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenContext {
|
||||
return $this->v1->secondaryAuthToken();
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts]';
|
||||
}
|
||||
}
|
||||
102
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1.php
vendored
Normal file
102
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1.php
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts;
|
||||
|
||||
use Twilio\Domain;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Rest\Accounts\V1\AuthTokenPromotionList;
|
||||
use Twilio\Rest\Accounts\V1\CredentialList;
|
||||
use Twilio\Rest\Accounts\V1\SecondaryAuthTokenList;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property AuthTokenPromotionList $authTokenPromotion
|
||||
* @property CredentialList $credentials
|
||||
* @property SecondaryAuthTokenList $secondaryAuthToken
|
||||
*/
|
||||
class V1 extends Version {
|
||||
protected $_authTokenPromotion;
|
||||
protected $_credentials;
|
||||
protected $_secondaryAuthToken;
|
||||
|
||||
/**
|
||||
* Construct the V1 version of Accounts
|
||||
*
|
||||
* @param Domain $domain Domain that contains the version
|
||||
*/
|
||||
public function __construct(Domain $domain) {
|
||||
parent::__construct($domain);
|
||||
$this->version = 'v1';
|
||||
}
|
||||
|
||||
protected function getAuthTokenPromotion(): AuthTokenPromotionList {
|
||||
if (!$this->_authTokenPromotion) {
|
||||
$this->_authTokenPromotion = new AuthTokenPromotionList($this);
|
||||
}
|
||||
return $this->_authTokenPromotion;
|
||||
}
|
||||
|
||||
protected function getCredentials(): CredentialList {
|
||||
if (!$this->_credentials) {
|
||||
$this->_credentials = new CredentialList($this);
|
||||
}
|
||||
return $this->_credentials;
|
||||
}
|
||||
|
||||
protected function getSecondaryAuthToken(): SecondaryAuthTokenList {
|
||||
if (!$this->_secondaryAuthToken) {
|
||||
$this->_secondaryAuthToken = new SecondaryAuthTokenList($this);
|
||||
}
|
||||
return $this->_secondaryAuthToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Accounts.V1]';
|
||||
}
|
||||
}
|
||||
56
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php
vendored
Normal file
56
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class AuthTokenPromotionContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the AuthTokenPromotionContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
*/
|
||||
public function __construct(Version $version) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = [];
|
||||
|
||||
$this->uri = '/AuthTokens/Promote';
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the AuthTokenPromotionInstance
|
||||
*
|
||||
* @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(): AuthTokenPromotionInstance {
|
||||
$payload = $this->version->update('POST', $this->uri);
|
||||
|
||||
return new AuthTokenPromotionInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Accounts.V1.AuthTokenPromotionContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
103
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php
vendored
Normal file
103
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property string $authToken
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $url
|
||||
*/
|
||||
class AuthTokenPromotionInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the AuthTokenPromotionInstance
|
||||
*
|
||||
* @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 = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'authToken' => Values::array_get($payload, 'auth_token'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'url' => Values::array_get($payload, 'url'),
|
||||
];
|
||||
|
||||
$this->solution = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return AuthTokenPromotionContext Context for this AuthTokenPromotionInstance
|
||||
*/
|
||||
protected function proxy(): AuthTokenPromotionContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new AuthTokenPromotionContext($this->version);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the AuthTokenPromotionInstance
|
||||
*
|
||||
* @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(): AuthTokenPromotionInstance {
|
||||
return $this->proxy()->update();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Accounts.V1.AuthTokenPromotionInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
43
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php
vendored
Normal file
43
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Version;
|
||||
|
||||
class AuthTokenPromotionList extends ListResource {
|
||||
/**
|
||||
* Construct the AuthTokenPromotionList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
*/
|
||||
public function __construct(Version $version) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a AuthTokenPromotionContext
|
||||
*/
|
||||
public function getContext(): AuthTokenPromotionContext {
|
||||
return new AuthTokenPromotionContext($this->version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.AuthTokenPromotionList]';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class AuthTokenPromotionPage 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 AuthTokenPromotionInstance \Twilio\Rest\Accounts\V1\AuthTokenPromotionInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): AuthTokenPromotionInstance {
|
||||
return new AuthTokenPromotionInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.AuthTokenPromotionPage]';
|
||||
}
|
||||
}
|
||||
85
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php
vendored
Normal file
85
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class AwsContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the AwsContext
|
||||
*
|
||||
* @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 = '/Credentials/AWS/' . \rawurlencode($sid) . '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the AwsInstance
|
||||
*
|
||||
* @return AwsInstance Fetched AwsInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): AwsInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new AwsInstance($this->version, $payload, $this->solution['sid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the AwsInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return AwsInstance Updated AwsInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): AwsInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of(['FriendlyName' => $options['friendlyName'], ]);
|
||||
|
||||
$payload = $this->version->update('POST', $this->uri, [], $data);
|
||||
|
||||
return new AwsInstance($this->version, $payload, $this->solution['sid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the AwsInstance
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Accounts.V1.AwsContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
128
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php
vendored
Normal file
128
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $sid
|
||||
* @property string $accountSid
|
||||
* @property string $friendlyName
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $url
|
||||
*/
|
||||
class AwsInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the AwsInstance
|
||||
*
|
||||
* @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 = [
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'url' => Values::array_get($payload, 'url'),
|
||||
];
|
||||
|
||||
$this->solution = ['sid' => $sid ?: $this->properties['sid'], ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return AwsContext Context for this AwsInstance
|
||||
*/
|
||||
protected function proxy(): AwsContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new AwsContext($this->version, $this->solution['sid']);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the AwsInstance
|
||||
*
|
||||
* @return AwsInstance Fetched AwsInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): AwsInstance {
|
||||
return $this->proxy()->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the AwsInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return AwsInstance Updated AwsInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): AwsInstance {
|
||||
return $this->proxy()->update($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the AwsInstance
|
||||
*
|
||||
* @return bool True if delete succeeds, false otherwise
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function delete(): bool {
|
||||
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(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.Accounts.V1.AwsInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
153
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsList.php
vendored
Normal file
153
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsList.php
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class AwsList extends ListResource {
|
||||
/**
|
||||
* Construct the AwsList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
*/
|
||||
public function __construct(Version $version) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = [];
|
||||
|
||||
$this->uri = '/Credentials/AWS';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams AwsInstance 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 AwsInstance 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 AwsInstance[] 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 AwsInstance 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 AwsPage Page of AwsInstance
|
||||
*/
|
||||
public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): AwsPage {
|
||||
$params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new AwsPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of AwsInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return AwsPage Page of AwsInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): AwsPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new AwsPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the AwsInstance
|
||||
*
|
||||
* @param string $credentials A string that contains the AWS access credentials
|
||||
* in the format
|
||||
* <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return AwsInstance Created AwsInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(string $credentials, array $options = []): AwsInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'Credentials' => $credentials,
|
||||
'FriendlyName' => $options['friendlyName'],
|
||||
'AccountSid' => $options['accountSid'],
|
||||
]);
|
||||
|
||||
$payload = $this->version->create('POST', $this->uri, [], $data);
|
||||
|
||||
return new AwsInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a AwsContext
|
||||
*
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function getContext(string $sid): AwsContext {
|
||||
return new AwsContext($this->version, $sid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.AwsList]';
|
||||
}
|
||||
}
|
||||
108
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php
vendored
Normal file
108
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class AwsOptions {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @param string $accountSid The Subaccount this Credential should be
|
||||
* associated with.
|
||||
* @return CreateAwsOptions Options builder
|
||||
*/
|
||||
public static function create(string $friendlyName = Values::NONE, string $accountSid = Values::NONE): CreateAwsOptions {
|
||||
return new CreateAwsOptions($friendlyName, $accountSid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @return UpdateAwsOptions Options builder
|
||||
*/
|
||||
public static function update(string $friendlyName = Values::NONE): UpdateAwsOptions {
|
||||
return new UpdateAwsOptions($friendlyName);
|
||||
}
|
||||
}
|
||||
|
||||
class CreateAwsOptions extends Options {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @param string $accountSid The Subaccount this Credential should be
|
||||
* associated with.
|
||||
*/
|
||||
public function __construct(string $friendlyName = Values::NONE, string $accountSid = Values::NONE) {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
$this->options['accountSid'] = $accountSid;
|
||||
}
|
||||
|
||||
/**
|
||||
* A descriptive string that you create to describe the resource. It can be up to 64 characters long.
|
||||
*
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request.
|
||||
*
|
||||
* @param string $accountSid The Subaccount this Credential should be
|
||||
* associated with.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAccountSid(string $accountSid): self {
|
||||
$this->options['accountSid'] = $accountSid;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Accounts.V1.CreateAwsOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateAwsOptions extends Options {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
*/
|
||||
public function __construct(string $friendlyName = Values::NONE) {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
}
|
||||
|
||||
/**
|
||||
* A descriptive string that you create to describe the resource. It can be up to 64 characters long.
|
||||
*
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Accounts.V1.UpdateAwsOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class AwsPage 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 AwsInstance \Twilio\Rest\Accounts\V1\Credential\AwsInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): AwsInstance {
|
||||
return new AwsInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.AwsPage]';
|
||||
}
|
||||
}
|
||||
85
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php
vendored
Normal file
85
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class PublicKeyContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the PublicKeyContext
|
||||
*
|
||||
* @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 = '/Credentials/PublicKeys/' . \rawurlencode($sid) . '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the PublicKeyInstance
|
||||
*
|
||||
* @return PublicKeyInstance Fetched PublicKeyInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): PublicKeyInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new PublicKeyInstance($this->version, $payload, $this->solution['sid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the PublicKeyInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return PublicKeyInstance Updated PublicKeyInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): PublicKeyInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of(['FriendlyName' => $options['friendlyName'], ]);
|
||||
|
||||
$payload = $this->version->update('POST', $this->uri, [], $data);
|
||||
|
||||
return new PublicKeyInstance($this->version, $payload, $this->solution['sid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the PublicKeyInstance
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Accounts.V1.PublicKeyContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
128
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php
vendored
Normal file
128
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $sid
|
||||
* @property string $accountSid
|
||||
* @property string $friendlyName
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $url
|
||||
*/
|
||||
class PublicKeyInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the PublicKeyInstance
|
||||
*
|
||||
* @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 = [
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'url' => Values::array_get($payload, 'url'),
|
||||
];
|
||||
|
||||
$this->solution = ['sid' => $sid ?: $this->properties['sid'], ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return PublicKeyContext Context for this PublicKeyInstance
|
||||
*/
|
||||
protected function proxy(): PublicKeyContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new PublicKeyContext($this->version, $this->solution['sid']);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the PublicKeyInstance
|
||||
*
|
||||
* @return PublicKeyInstance Fetched PublicKeyInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): PublicKeyInstance {
|
||||
return $this->proxy()->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the PublicKeyInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return PublicKeyInstance Updated PublicKeyInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): PublicKeyInstance {
|
||||
return $this->proxy()->update($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the PublicKeyInstance
|
||||
*
|
||||
* @return bool True if delete succeeds, false otherwise
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function delete(): bool {
|
||||
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(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.Accounts.V1.PublicKeyInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
151
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php
vendored
Normal file
151
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class PublicKeyList extends ListResource {
|
||||
/**
|
||||
* Construct the PublicKeyList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
*/
|
||||
public function __construct(Version $version) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = [];
|
||||
|
||||
$this->uri = '/Credentials/PublicKeys';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams PublicKeyInstance 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 PublicKeyInstance 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 PublicKeyInstance[] 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 PublicKeyInstance 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 PublicKeyPage Page of PublicKeyInstance
|
||||
*/
|
||||
public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): PublicKeyPage {
|
||||
$params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new PublicKeyPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of PublicKeyInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return PublicKeyPage Page of PublicKeyInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): PublicKeyPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new PublicKeyPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the PublicKeyInstance
|
||||
*
|
||||
* @param string $publicKey A URL encoded representation of the public key
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return PublicKeyInstance Created PublicKeyInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(string $publicKey, array $options = []): PublicKeyInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'PublicKey' => $publicKey,
|
||||
'FriendlyName' => $options['friendlyName'],
|
||||
'AccountSid' => $options['accountSid'],
|
||||
]);
|
||||
|
||||
$payload = $this->version->create('POST', $this->uri, [], $data);
|
||||
|
||||
return new PublicKeyInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a PublicKeyContext
|
||||
*
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function getContext(string $sid): PublicKeyContext {
|
||||
return new PublicKeyContext($this->version, $sid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.PublicKeyList]';
|
||||
}
|
||||
}
|
||||
108
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php
vendored
Normal file
108
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class PublicKeyOptions {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @param string $accountSid The Subaccount this Credential should be
|
||||
* associated with.
|
||||
* @return CreatePublicKeyOptions Options builder
|
||||
*/
|
||||
public static function create(string $friendlyName = Values::NONE, string $accountSid = Values::NONE): CreatePublicKeyOptions {
|
||||
return new CreatePublicKeyOptions($friendlyName, $accountSid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @return UpdatePublicKeyOptions Options builder
|
||||
*/
|
||||
public static function update(string $friendlyName = Values::NONE): UpdatePublicKeyOptions {
|
||||
return new UpdatePublicKeyOptions($friendlyName);
|
||||
}
|
||||
}
|
||||
|
||||
class CreatePublicKeyOptions extends Options {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @param string $accountSid The Subaccount this Credential should be
|
||||
* associated with.
|
||||
*/
|
||||
public function __construct(string $friendlyName = Values::NONE, string $accountSid = Values::NONE) {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
$this->options['accountSid'] = $accountSid;
|
||||
}
|
||||
|
||||
/**
|
||||
* A descriptive string that you create to describe the resource. It can be up to 64 characters long.
|
||||
*
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request
|
||||
*
|
||||
* @param string $accountSid The Subaccount this Credential should be
|
||||
* associated with.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAccountSid(string $accountSid): self {
|
||||
$this->options['accountSid'] = $accountSid;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Accounts.V1.CreatePublicKeyOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
|
||||
class UpdatePublicKeyOptions extends Options {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
*/
|
||||
public function __construct(string $friendlyName = Values::NONE) {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
}
|
||||
|
||||
/**
|
||||
* A descriptive string that you create to describe the resource. It can be up to 64 characters long.
|
||||
*
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Accounts.V1.UpdatePublicKeyOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1\Credential;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class PublicKeyPage 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 PublicKeyInstance \Twilio\Rest\Accounts\V1\Credential\PublicKeyInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): PublicKeyInstance {
|
||||
return new PublicKeyInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.PublicKeyPage]';
|
||||
}
|
||||
}
|
||||
58
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialInstance.php
vendored
Normal file
58
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialInstance.php
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class CredentialInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the CredentialInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
*/
|
||||
public function __construct(Version $version, array $payload) {
|
||||
parent::__construct($version);
|
||||
|
||||
$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.Accounts.V1.CredentialInstance]';
|
||||
}
|
||||
}
|
||||
104
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialList.php
vendored
Normal file
104
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialList.php
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Rest\Accounts\V1\Credential\AwsList;
|
||||
use Twilio\Rest\Accounts\V1\Credential\PublicKeyList;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property PublicKeyList $publicKey
|
||||
* @property AwsList $aws
|
||||
* @method \Twilio\Rest\Accounts\V1\Credential\PublicKeyContext publicKey(string $sid)
|
||||
* @method \Twilio\Rest\Accounts\V1\Credential\AwsContext aws(string $sid)
|
||||
*/
|
||||
class CredentialList extends ListResource {
|
||||
protected $_publicKey = null;
|
||||
protected $_aws = null;
|
||||
|
||||
/**
|
||||
* Construct the CredentialList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
*/
|
||||
public function __construct(Version $version) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the publicKey
|
||||
*/
|
||||
protected function getPublicKey(): PublicKeyList {
|
||||
if (!$this->_publicKey) {
|
||||
$this->_publicKey = new PublicKeyList($this->version);
|
||||
}
|
||||
|
||||
return $this->_publicKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the aws
|
||||
*/
|
||||
protected function getAws(): AwsList {
|
||||
if (!$this->_aws) {
|
||||
$this->_aws = new AwsList($this->version);
|
||||
}
|
||||
|
||||
return $this->_aws;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic getter to lazy load subresources
|
||||
*
|
||||
* @param string $name Subresource to return
|
||||
* @return \Twilio\ListResource The requested subresource
|
||||
* @throws TwilioException For unknown subresources
|
||||
*/
|
||||
public function __get(string $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 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.Accounts.V1.CredentialList]';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/CredentialPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class CredentialPage 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 CredentialInstance \Twilio\Rest\Accounts\V1\CredentialInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): CredentialInstance {
|
||||
return new CredentialInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.CredentialPage]';
|
||||
}
|
||||
}
|
||||
66
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php
vendored
Normal file
66
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class SecondaryAuthTokenContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the SecondaryAuthTokenContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
*/
|
||||
public function __construct(Version $version) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = [];
|
||||
|
||||
$this->uri = '/AuthTokens/Secondary';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the SecondaryAuthTokenInstance
|
||||
*
|
||||
* @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(): SecondaryAuthTokenInstance {
|
||||
$payload = $this->version->create('POST', $this->uri);
|
||||
|
||||
return new SecondaryAuthTokenInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the SecondaryAuthTokenInstance
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Accounts.V1.SecondaryAuthTokenContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
113
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php
vendored
Normal file
113
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $secondaryAuthToken
|
||||
* @property string $url
|
||||
*/
|
||||
class SecondaryAuthTokenInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the SecondaryAuthTokenInstance
|
||||
*
|
||||
* @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 = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'secondaryAuthToken' => Values::array_get($payload, 'secondary_auth_token'),
|
||||
'url' => Values::array_get($payload, 'url'),
|
||||
];
|
||||
|
||||
$this->solution = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return SecondaryAuthTokenContext Context for this SecondaryAuthTokenInstance
|
||||
*/
|
||||
protected function proxy(): SecondaryAuthTokenContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new SecondaryAuthTokenContext($this->version);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the SecondaryAuthTokenInstance
|
||||
*
|
||||
* @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(): SecondaryAuthTokenInstance {
|
||||
return $this->proxy()->create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the SecondaryAuthTokenInstance
|
||||
*
|
||||
* @return bool True if delete succeeds, false otherwise
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function delete(): bool {
|
||||
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(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.Accounts.V1.SecondaryAuthTokenInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
43
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php
vendored
Normal file
43
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Version;
|
||||
|
||||
class SecondaryAuthTokenList extends ListResource {
|
||||
/**
|
||||
* Construct the SecondaryAuthTokenList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
*/
|
||||
public function __construct(Version $version) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a SecondaryAuthTokenContext
|
||||
*/
|
||||
public function getContext(): SecondaryAuthTokenContext {
|
||||
return new SecondaryAuthTokenContext($this->version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.SecondaryAuthTokenList]';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Accounts\V1;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class SecondaryAuthTokenPage 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 SecondaryAuthTokenInstance \Twilio\Rest\Accounts\V1\SecondaryAuthTokenInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): SecondaryAuthTokenInstance {
|
||||
return new SecondaryAuthTokenInstance($this->version, $payload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Accounts.V1.SecondaryAuthTokenPage]';
|
||||
}
|
||||
}
|
||||
363
vendor/twilio/sdk/src/Twilio/Rest/Api.php
vendored
Normal file
363
vendor/twilio/sdk/src/Twilio/Rest/Api.php
vendored
Normal file
@@ -0,0 +1,363 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest;
|
||||
|
||||
use Twilio\Domain;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\Rest\Api\V2010;
|
||||
|
||||
/**
|
||||
* @property \Twilio\Rest\Api\V2010 $v2010
|
||||
* @property \Twilio\Rest\Api\V2010\AccountList $accounts
|
||||
* @property \Twilio\Rest\Api\V2010\AccountContext $account
|
||||
* @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications
|
||||
* @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps
|
||||
* @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers
|
||||
* @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance
|
||||
* @property \Twilio\Rest\Api\V2010\Account\CallList $calls
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps
|
||||
* @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers
|
||||
* @property \Twilio\Rest\Api\V2010\Account\KeyList $keys
|
||||
* @property \Twilio\Rest\Api\V2010\Account\MessageList $messages
|
||||
* @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys
|
||||
* @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys
|
||||
* @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications
|
||||
* @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds
|
||||
* @property \Twilio\Rest\Api\V2010\Account\QueueList $queues
|
||||
* @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings
|
||||
* @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys
|
||||
* @property \Twilio\Rest\Api\V2010\Account\SipList $sip
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes
|
||||
* @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens
|
||||
* @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions
|
||||
* @property \Twilio\Rest\Api\V2010\Account\UsageList $usage
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests
|
||||
* @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid)
|
||||
*/
|
||||
class Api extends Domain {
|
||||
protected $_v2010;
|
||||
|
||||
/**
|
||||
* Construct the Api Domain
|
||||
*
|
||||
* @param Client $client Client to communicate with Twilio
|
||||
*/
|
||||
public function __construct(Client $client) {
|
||||
parent::__construct($client);
|
||||
|
||||
$this->baseUrl = 'https://api.twilio.com';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return V2010 Version v2010 of api
|
||||
*/
|
||||
protected function getV2010(): V2010 {
|
||||
if (!$this->_v2010) {
|
||||
$this->_v2010 = new V2010($this);
|
||||
}
|
||||
return $this->_v2010;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic getter to lazy load version
|
||||
*
|
||||
* @param string $name Version to return
|
||||
* @return \Twilio\Version The requested version
|
||||
* @throws TwilioException For unknown versions
|
||||
*/
|
||||
public function __get(string $name) {
|
||||
$method = 'get' . \ucfirst($name);
|
||||
if (\method_exists($this, $method)) {
|
||||
return $this->$method();
|
||||
}
|
||||
|
||||
throw new TwilioException('Unknown version ' . $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic caller to get resource contexts
|
||||
*
|
||||
* @param string $name Resource to return
|
||||
* @param array $arguments Context parameters
|
||||
* @return \Twilio\InstanceContext The requested resource context
|
||||
* @throws TwilioException For unknown resource
|
||||
*/
|
||||
public function __call(string $name, array $arguments) {
|
||||
$method = 'context' . \ucfirst($name);
|
||||
if (\method_exists($this, $method)) {
|
||||
return \call_user_func_array([$this, $method], $arguments);
|
||||
}
|
||||
|
||||
throw new TwilioException('Unknown context ' . $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the
|
||||
* authenticating account
|
||||
*/
|
||||
protected function getAccount(): \Twilio\Rest\Api\V2010\AccountContext {
|
||||
return $this->v2010->account;
|
||||
}
|
||||
|
||||
protected function getAccounts(): \Twilio\Rest\Api\V2010\AccountList {
|
||||
return $this->v2010->accounts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid Fetch by unique Account Sid
|
||||
*/
|
||||
protected function contextAccounts(string $sid): \Twilio\Rest\Api\V2010\AccountContext {
|
||||
return $this->v2010->accounts($sid);
|
||||
}
|
||||
|
||||
protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList {
|
||||
return $this->v2010->account->addresses;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextAddresses(string $sid): \Twilio\Rest\Api\V2010\Account\AddressContext {
|
||||
return $this->v2010->account->addresses($sid);
|
||||
}
|
||||
|
||||
protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList {
|
||||
return $this->v2010->account->applications;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextApplications(string $sid): \Twilio\Rest\Api\V2010\Account\ApplicationContext {
|
||||
return $this->v2010->account->applications($sid);
|
||||
}
|
||||
|
||||
protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList {
|
||||
return $this->v2010->account->authorizedConnectApps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $connectAppSid The SID of the Connect App to fetch
|
||||
*/
|
||||
protected function contextAuthorizedConnectApps(string $connectAppSid): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext {
|
||||
return $this->v2010->account->authorizedConnectApps($connectAppSid);
|
||||
}
|
||||
|
||||
protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList {
|
||||
return $this->v2010->account->availablePhoneNumbers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $countryCode The ISO country code of the country to fetch
|
||||
* available phone number information about
|
||||
*/
|
||||
protected function contextAvailablePhoneNumbers(string $countryCode): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext {
|
||||
return $this->v2010->account->availablePhoneNumbers($countryCode);
|
||||
}
|
||||
|
||||
protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList {
|
||||
return $this->v2010->account->balance;
|
||||
}
|
||||
|
||||
protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList {
|
||||
return $this->v2010->account->calls;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The SID of the Call resource to fetch
|
||||
*/
|
||||
protected function contextCalls(string $sid): \Twilio\Rest\Api\V2010\Account\CallContext {
|
||||
return $this->v2010->account->calls($sid);
|
||||
}
|
||||
|
||||
protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList {
|
||||
return $this->v2010->account->conferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies this resource
|
||||
*/
|
||||
protected function contextConferences(string $sid): \Twilio\Rest\Api\V2010\Account\ConferenceContext {
|
||||
return $this->v2010->account->conferences($sid);
|
||||
}
|
||||
|
||||
protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList {
|
||||
return $this->v2010->account->connectApps;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextConnectApps(string $sid): \Twilio\Rest\Api\V2010\Account\ConnectAppContext {
|
||||
return $this->v2010->account->connectApps($sid);
|
||||
}
|
||||
|
||||
protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList {
|
||||
return $this->v2010->account->incomingPhoneNumbers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextIncomingPhoneNumbers(string $sid): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext {
|
||||
return $this->v2010->account->incomingPhoneNumbers($sid);
|
||||
}
|
||||
|
||||
protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList {
|
||||
return $this->v2010->account->keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextKeys(string $sid): \Twilio\Rest\Api\V2010\Account\KeyContext {
|
||||
return $this->v2010->account->keys($sid);
|
||||
}
|
||||
|
||||
protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList {
|
||||
return $this->v2010->account->messages;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextMessages(string $sid): \Twilio\Rest\Api\V2010\Account\MessageContext {
|
||||
return $this->v2010->account->messages($sid);
|
||||
}
|
||||
|
||||
protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList {
|
||||
return $this->v2010->account->newKeys;
|
||||
}
|
||||
|
||||
protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList {
|
||||
return $this->v2010->account->newSigningKeys;
|
||||
}
|
||||
|
||||
protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList {
|
||||
return $this->v2010->account->notifications;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextNotifications(string $sid): \Twilio\Rest\Api\V2010\Account\NotificationContext {
|
||||
return $this->v2010->account->notifications($sid);
|
||||
}
|
||||
|
||||
protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList {
|
||||
return $this->v2010->account->outgoingCallerIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextOutgoingCallerIds(string $sid): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext {
|
||||
return $this->v2010->account->outgoingCallerIds($sid);
|
||||
}
|
||||
|
||||
protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList {
|
||||
return $this->v2010->account->queues;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies this resource
|
||||
*/
|
||||
protected function contextQueues(string $sid): \Twilio\Rest\Api\V2010\Account\QueueContext {
|
||||
return $this->v2010->account->queues($sid);
|
||||
}
|
||||
|
||||
protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList {
|
||||
return $this->v2010->account->recordings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext {
|
||||
return $this->v2010->account->recordings($sid);
|
||||
}
|
||||
|
||||
protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList {
|
||||
return $this->v2010->account->signingKeys;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The sid
|
||||
*/
|
||||
protected function contextSigningKeys(string $sid): \Twilio\Rest\Api\V2010\Account\SigningKeyContext {
|
||||
return $this->v2010->account->signingKeys($sid);
|
||||
}
|
||||
|
||||
protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList {
|
||||
return $this->v2010->account->sip;
|
||||
}
|
||||
|
||||
protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList {
|
||||
return $this->v2010->account->shortCodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies this resource
|
||||
*/
|
||||
protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext {
|
||||
return $this->v2010->account->shortCodes($sid);
|
||||
}
|
||||
|
||||
protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList {
|
||||
return $this->v2010->account->tokens;
|
||||
}
|
||||
|
||||
protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList {
|
||||
return $this->v2010->account->transcriptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
protected function contextTranscriptions(string $sid): \Twilio\Rest\Api\V2010\Account\TranscriptionContext {
|
||||
return $this->v2010->account->transcriptions($sid);
|
||||
}
|
||||
|
||||
protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList {
|
||||
return $this->v2010->account->usage;
|
||||
}
|
||||
|
||||
protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList {
|
||||
return $this->v2010->account->validationRequests;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api]';
|
||||
}
|
||||
}
|
||||
271
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010.php
vendored
Normal file
271
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010.php
vendored
Normal file
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api;
|
||||
|
||||
use Twilio\Domain;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Rest\Api\V2010\AccountContext;
|
||||
use Twilio\Rest\Api\V2010\AccountInstance;
|
||||
use Twilio\Rest\Api\V2010\AccountList;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property AccountList $accounts
|
||||
* @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid)
|
||||
* @property AccountContext $account
|
||||
* @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications
|
||||
* @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps
|
||||
* @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers
|
||||
* @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance
|
||||
* @property \Twilio\Rest\Api\V2010\Account\CallList $calls
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps
|
||||
* @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers
|
||||
* @property \Twilio\Rest\Api\V2010\Account\KeyList $keys
|
||||
* @property \Twilio\Rest\Api\V2010\Account\MessageList $messages
|
||||
* @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys
|
||||
* @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys
|
||||
* @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications
|
||||
* @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds
|
||||
* @property \Twilio\Rest\Api\V2010\Account\QueueList $queues
|
||||
* @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings
|
||||
* @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys
|
||||
* @property \Twilio\Rest\Api\V2010\Account\SipList $sip
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes
|
||||
* @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens
|
||||
* @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions
|
||||
* @property \Twilio\Rest\Api\V2010\Account\UsageList $usage
|
||||
* @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests
|
||||
* @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid)
|
||||
* @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid)
|
||||
*/
|
||||
class V2010 extends Version {
|
||||
protected $_accounts;
|
||||
protected $_account = null;
|
||||
protected $_addresses = null;
|
||||
protected $_applications = null;
|
||||
protected $_authorizedConnectApps = null;
|
||||
protected $_availablePhoneNumbers = null;
|
||||
protected $_balance = null;
|
||||
protected $_calls = null;
|
||||
protected $_conferences = null;
|
||||
protected $_connectApps = null;
|
||||
protected $_incomingPhoneNumbers = null;
|
||||
protected $_keys = null;
|
||||
protected $_messages = null;
|
||||
protected $_newKeys = null;
|
||||
protected $_newSigningKeys = null;
|
||||
protected $_notifications = null;
|
||||
protected $_outgoingCallerIds = null;
|
||||
protected $_queues = null;
|
||||
protected $_recordings = null;
|
||||
protected $_signingKeys = null;
|
||||
protected $_sip = null;
|
||||
protected $_shortCodes = null;
|
||||
protected $_tokens = null;
|
||||
protected $_transcriptions = null;
|
||||
protected $_usage = null;
|
||||
protected $_validationRequests = null;
|
||||
|
||||
/**
|
||||
* Construct the V2010 version of Api
|
||||
*
|
||||
* @param Domain $domain Domain that contains the version
|
||||
*/
|
||||
public function __construct(Domain $domain) {
|
||||
parent::__construct($domain);
|
||||
$this->version = '2010-04-01';
|
||||
}
|
||||
|
||||
protected function getAccounts(): AccountList {
|
||||
if (!$this->_accounts) {
|
||||
$this->_accounts = new AccountList($this);
|
||||
}
|
||||
return $this->_accounts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AccountContext Account provided as the authenticating account
|
||||
*/
|
||||
protected function getAccount(): AccountContext {
|
||||
if (!$this->_account) {
|
||||
$this->_account = new AccountContext(
|
||||
$this,
|
||||
$this->domain->getClient()->getAccountSid()
|
||||
);
|
||||
}
|
||||
return $this->_account;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter to override the primary account
|
||||
*
|
||||
* @param AccountContext|AccountInstance $account account to use as the primary
|
||||
* account
|
||||
*/
|
||||
public function setAccount($account): void {
|
||||
$this->_account = $account;
|
||||
}
|
||||
|
||||
protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList {
|
||||
return $this->account->addresses;
|
||||
}
|
||||
|
||||
protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList {
|
||||
return $this->account->applications;
|
||||
}
|
||||
|
||||
protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList {
|
||||
return $this->account->authorizedConnectApps;
|
||||
}
|
||||
|
||||
protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList {
|
||||
return $this->account->availablePhoneNumbers;
|
||||
}
|
||||
|
||||
protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList {
|
||||
return $this->account->balance;
|
||||
}
|
||||
|
||||
protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList {
|
||||
return $this->account->calls;
|
||||
}
|
||||
|
||||
protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList {
|
||||
return $this->account->conferences;
|
||||
}
|
||||
|
||||
protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList {
|
||||
return $this->account->connectApps;
|
||||
}
|
||||
|
||||
protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList {
|
||||
return $this->account->incomingPhoneNumbers;
|
||||
}
|
||||
|
||||
protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList {
|
||||
return $this->account->keys;
|
||||
}
|
||||
|
||||
protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList {
|
||||
return $this->account->messages;
|
||||
}
|
||||
|
||||
protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList {
|
||||
return $this->account->newKeys;
|
||||
}
|
||||
|
||||
protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList {
|
||||
return $this->account->newSigningKeys;
|
||||
}
|
||||
|
||||
protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList {
|
||||
return $this->account->notifications;
|
||||
}
|
||||
|
||||
protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList {
|
||||
return $this->account->outgoingCallerIds;
|
||||
}
|
||||
|
||||
protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList {
|
||||
return $this->account->queues;
|
||||
}
|
||||
|
||||
protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList {
|
||||
return $this->account->recordings;
|
||||
}
|
||||
|
||||
protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList {
|
||||
return $this->account->signingKeys;
|
||||
}
|
||||
|
||||
protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList {
|
||||
return $this->account->sip;
|
||||
}
|
||||
|
||||
protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList {
|
||||
return $this->account->shortCodes;
|
||||
}
|
||||
|
||||
protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList {
|
||||
return $this->account->tokens;
|
||||
}
|
||||
|
||||
protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList {
|
||||
return $this->account->transcriptions;
|
||||
}
|
||||
|
||||
protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList {
|
||||
return $this->account->usage;
|
||||
}
|
||||
|
||||
protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList {
|
||||
return $this->account->validationRequests;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010]';
|
||||
}
|
||||
}
|
||||
119
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php
vendored
Normal file
119
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Address;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $sid
|
||||
* @property string $accountSid
|
||||
* @property string $friendlyName
|
||||
* @property string $phoneNumber
|
||||
* @property string $voiceUrl
|
||||
* @property string $voiceMethod
|
||||
* @property string $voiceFallbackMethod
|
||||
* @property string $voiceFallbackUrl
|
||||
* @property bool $voiceCallerIdLookup
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $smsFallbackMethod
|
||||
* @property string $smsFallbackUrl
|
||||
* @property string $smsMethod
|
||||
* @property string $smsUrl
|
||||
* @property string $addressRequirements
|
||||
* @property array $capabilities
|
||||
* @property string $statusCallback
|
||||
* @property string $statusCallbackMethod
|
||||
* @property string $apiVersion
|
||||
* @property string $smsApplicationSid
|
||||
* @property string $voiceApplicationSid
|
||||
* @property string $trunkSid
|
||||
* @property string $emergencyStatus
|
||||
* @property string $emergencyAddressSid
|
||||
* @property string $uri
|
||||
*/
|
||||
class DependentPhoneNumberInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the DependentPhoneNumberInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* @param string $addressSid The unique string that identifies the resource
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $addressSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'phoneNumber' => Values::array_get($payload, 'phone_number'),
|
||||
'voiceUrl' => Values::array_get($payload, 'voice_url'),
|
||||
'voiceMethod' => Values::array_get($payload, 'voice_method'),
|
||||
'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'),
|
||||
'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'),
|
||||
'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'),
|
||||
'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'),
|
||||
'smsMethod' => Values::array_get($payload, 'sms_method'),
|
||||
'smsUrl' => Values::array_get($payload, 'sms_url'),
|
||||
'addressRequirements' => Values::array_get($payload, 'address_requirements'),
|
||||
'capabilities' => Values::array_get($payload, 'capabilities'),
|
||||
'statusCallback' => Values::array_get($payload, 'status_callback'),
|
||||
'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'),
|
||||
'apiVersion' => Values::array_get($payload, 'api_version'),
|
||||
'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'),
|
||||
'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'),
|
||||
'trunkSid' => Values::array_get($payload, 'trunk_sid'),
|
||||
'emergencyStatus' => Values::array_get($payload, 'emergency_status'),
|
||||
'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'),
|
||||
'uri' => Values::array_get($payload, 'uri'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'addressSid' => $addressSid, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.DependentPhoneNumberInstance]';
|
||||
}
|
||||
}
|
||||
122
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php
vendored
Normal file
122
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Address;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class DependentPhoneNumberList extends ListResource {
|
||||
/**
|
||||
* Construct the DependentPhoneNumberList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* @param string $addressSid The unique string that identifies the resource
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $addressSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'addressSid' => $addressSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Addresses/' . \rawurlencode($addressSid) . '/DependentPhoneNumbers.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams DependentPhoneNumberInstance 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 DependentPhoneNumberInstance 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 DependentPhoneNumberInstance[] 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 DependentPhoneNumberInstance 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 DependentPhoneNumberPage Page of DependentPhoneNumberInstance
|
||||
*/
|
||||
public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): DependentPhoneNumberPage {
|
||||
$params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new DependentPhoneNumberPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of DependentPhoneNumberInstance records from the
|
||||
* API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return DependentPhoneNumberPage Page of DependentPhoneNumberInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): DependentPhoneNumberPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new DependentPhoneNumberPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.DependentPhoneNumberList]';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Address;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class DependentPhoneNumberPage 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 DependentPhoneNumberInstance \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): DependentPhoneNumberInstance {
|
||||
return new DependentPhoneNumberInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['addressSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.DependentPhoneNumberPage]';
|
||||
}
|
||||
}
|
||||
163
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressContext.php
vendored
Normal file
163
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressContext.php
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property DependentPhoneNumberList $dependentPhoneNumbers
|
||||
*/
|
||||
class AddressContext extends InstanceContext {
|
||||
protected $_dependentPhoneNumbers;
|
||||
|
||||
/**
|
||||
* Initialize the AddressContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that is responsible for
|
||||
* this address
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function __construct(Version $version, $accountSid, $sid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Addresses/' . \rawurlencode($sid) . '.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the AddressInstance
|
||||
*
|
||||
* @return bool True if delete succeeds, false otherwise
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function delete(): bool {
|
||||
return $this->version->delete('DELETE', $this->uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the AddressInstance
|
||||
*
|
||||
* @return AddressInstance Fetched AddressInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): AddressInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new AddressInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the AddressInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return AddressInstance Updated AddressInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): AddressInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'FriendlyName' => $options['friendlyName'],
|
||||
'CustomerName' => $options['customerName'],
|
||||
'Street' => $options['street'],
|
||||
'City' => $options['city'],
|
||||
'Region' => $options['region'],
|
||||
'PostalCode' => $options['postalCode'],
|
||||
'EmergencyEnabled' => Serialize::booleanToString($options['emergencyEnabled']),
|
||||
'AutoCorrectAddress' => Serialize::booleanToString($options['autoCorrectAddress']),
|
||||
'StreetSecondary' => $options['streetSecondary'],
|
||||
]);
|
||||
|
||||
$payload = $this->version->update('POST', $this->uri, [], $data);
|
||||
|
||||
return new AddressInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the dependentPhoneNumbers
|
||||
*/
|
||||
protected function getDependentPhoneNumbers(): DependentPhoneNumberList {
|
||||
if (!$this->_dependentPhoneNumbers) {
|
||||
$this->_dependentPhoneNumbers = new DependentPhoneNumberList(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_dependentPhoneNumbers;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.AddressContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
164
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressInstance.php
vendored
Normal file
164
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressInstance.php
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property string $city
|
||||
* @property string $customerName
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $friendlyName
|
||||
* @property string $isoCountry
|
||||
* @property string $postalCode
|
||||
* @property string $region
|
||||
* @property string $sid
|
||||
* @property string $street
|
||||
* @property string $uri
|
||||
* @property bool $emergencyEnabled
|
||||
* @property bool $validated
|
||||
* @property bool $verified
|
||||
* @property string $streetSecondary
|
||||
*/
|
||||
class AddressInstance extends InstanceResource {
|
||||
protected $_dependentPhoneNumbers;
|
||||
|
||||
/**
|
||||
* Initialize the AddressInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The SID of the Account that is responsible for the
|
||||
* resource
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'city' => Values::array_get($payload, 'city'),
|
||||
'customerName' => Values::array_get($payload, 'customer_name'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'isoCountry' => Values::array_get($payload, 'iso_country'),
|
||||
'postalCode' => Values::array_get($payload, 'postal_code'),
|
||||
'region' => Values::array_get($payload, 'region'),
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
'street' => Values::array_get($payload, 'street'),
|
||||
'uri' => Values::array_get($payload, 'uri'),
|
||||
'emergencyEnabled' => Values::array_get($payload, 'emergency_enabled'),
|
||||
'validated' => Values::array_get($payload, 'validated'),
|
||||
'verified' => Values::array_get($payload, 'verified'),
|
||||
'streetSecondary' => Values::array_get($payload, 'street_secondary'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return AddressContext Context for this AddressInstance
|
||||
*/
|
||||
protected function proxy(): AddressContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new AddressContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the AddressInstance
|
||||
*
|
||||
* @return bool True if delete succeeds, false otherwise
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function delete(): bool {
|
||||
return $this->proxy()->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the AddressInstance
|
||||
*
|
||||
* @return AddressInstance Fetched AddressInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): AddressInstance {
|
||||
return $this->proxy()->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the AddressInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return AddressInstance Updated AddressInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): AddressInstance {
|
||||
return $this->proxy()->update($options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the dependentPhoneNumbers
|
||||
*/
|
||||
protected function getDependentPhoneNumbers(): DependentPhoneNumberList {
|
||||
return $this->proxy()->dependentPhoneNumbers;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.AddressInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
178
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressList.php
vendored
Normal file
178
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressList.php
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class AddressList extends ListResource {
|
||||
/**
|
||||
* Construct the AddressList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that is responsible for the
|
||||
* resource
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Addresses.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the AddressInstance
|
||||
*
|
||||
* @param string $customerName The name to associate with the new address
|
||||
* @param string $street The number and street address of the new address
|
||||
* @param string $city The city of the new address
|
||||
* @param string $region The state or region of the new address
|
||||
* @param string $postalCode The postal code of the new address
|
||||
* @param string $isoCountry The ISO country code of the new address
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return AddressInstance Created AddressInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(string $customerName, string $street, string $city, string $region, string $postalCode, string $isoCountry, array $options = []): AddressInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'CustomerName' => $customerName,
|
||||
'Street' => $street,
|
||||
'City' => $city,
|
||||
'Region' => $region,
|
||||
'PostalCode' => $postalCode,
|
||||
'IsoCountry' => $isoCountry,
|
||||
'FriendlyName' => $options['friendlyName'],
|
||||
'EmergencyEnabled' => Serialize::booleanToString($options['emergencyEnabled']),
|
||||
'AutoCorrectAddress' => Serialize::booleanToString($options['autoCorrectAddress']),
|
||||
'StreetSecondary' => $options['streetSecondary'],
|
||||
]);
|
||||
|
||||
$payload = $this->version->create('POST', $this->uri, [], $data);
|
||||
|
||||
return new AddressInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams AddressInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads AddressInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return AddressInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of AddressInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 AddressPage Page of AddressInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): AddressPage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'CustomerName' => $options['customerName'],
|
||||
'FriendlyName' => $options['friendlyName'],
|
||||
'IsoCountry' => $options['isoCountry'],
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new AddressPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of AddressInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return AddressPage Page of AddressInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): AddressPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new AddressPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a AddressContext
|
||||
*
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function getContext(string $sid): AddressContext {
|
||||
return new AddressContext($this->version, $this->solution['accountSid'], $sid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.AddressList]';
|
||||
}
|
||||
}
|
||||
338
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php
vendored
Normal file
338
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php
vendored
Normal file
@@ -0,0 +1,338 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class AddressOptions {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the new resource
|
||||
* @param bool $emergencyEnabled Whether to enable emergency calling on the new
|
||||
* address
|
||||
* @param bool $autoCorrectAddress Whether we should automatically correct the
|
||||
* address
|
||||
* @param string $streetSecondary The additional number and street address of
|
||||
* the address
|
||||
* @return CreateAddressOptions Options builder
|
||||
*/
|
||||
public static function create(string $friendlyName = Values::NONE, bool $emergencyEnabled = Values::NONE, bool $autoCorrectAddress = Values::NONE, string $streetSecondary = Values::NONE): CreateAddressOptions {
|
||||
return new CreateAddressOptions($friendlyName, $emergencyEnabled, $autoCorrectAddress, $streetSecondary);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @param string $customerName The name to associate with the address
|
||||
* @param string $street The number and street address of the address
|
||||
* @param string $city The city of the address
|
||||
* @param string $region The state or region of the address
|
||||
* @param string $postalCode The postal code of the address
|
||||
* @param bool $emergencyEnabled Whether to enable emergency calling on the
|
||||
* address
|
||||
* @param bool $autoCorrectAddress Whether we should automatically correct the
|
||||
* address
|
||||
* @param string $streetSecondary The additional number and street address of
|
||||
* the address
|
||||
* @return UpdateAddressOptions Options builder
|
||||
*/
|
||||
public static function update(string $friendlyName = Values::NONE, string $customerName = Values::NONE, string $street = Values::NONE, string $city = Values::NONE, string $region = Values::NONE, string $postalCode = Values::NONE, bool $emergencyEnabled = Values::NONE, bool $autoCorrectAddress = Values::NONE, string $streetSecondary = Values::NONE): UpdateAddressOptions {
|
||||
return new UpdateAddressOptions($friendlyName, $customerName, $street, $city, $region, $postalCode, $emergencyEnabled, $autoCorrectAddress, $streetSecondary);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $customerName The `customer_name` of the Address resources to
|
||||
* read
|
||||
* @param string $friendlyName The string that identifies the Address resources
|
||||
* to read
|
||||
* @param string $isoCountry The ISO country code of the Address resources to
|
||||
* read
|
||||
* @return ReadAddressOptions Options builder
|
||||
*/
|
||||
public static function read(string $customerName = Values::NONE, string $friendlyName = Values::NONE, string $isoCountry = Values::NONE): ReadAddressOptions {
|
||||
return new ReadAddressOptions($customerName, $friendlyName, $isoCountry);
|
||||
}
|
||||
}
|
||||
|
||||
class CreateAddressOptions extends Options {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the new resource
|
||||
* @param bool $emergencyEnabled Whether to enable emergency calling on the new
|
||||
* address
|
||||
* @param bool $autoCorrectAddress Whether we should automatically correct the
|
||||
* address
|
||||
* @param string $streetSecondary The additional number and street address of
|
||||
* the address
|
||||
*/
|
||||
public function __construct(string $friendlyName = Values::NONE, bool $emergencyEnabled = Values::NONE, bool $autoCorrectAddress = Values::NONE, string $streetSecondary = Values::NONE) {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
$this->options['emergencyEnabled'] = $emergencyEnabled;
|
||||
$this->options['autoCorrectAddress'] = $autoCorrectAddress;
|
||||
$this->options['streetSecondary'] = $streetSecondary;
|
||||
}
|
||||
|
||||
/**
|
||||
* A descriptive string that you create to describe the new address. It can be up to 64 characters long.
|
||||
*
|
||||
* @param string $friendlyName A string to describe the new resource
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to enable emergency calling on the new address. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $emergencyEnabled Whether to enable emergency calling on the new
|
||||
* address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setEmergencyEnabled(bool $emergencyEnabled): self {
|
||||
$this->options['emergencyEnabled'] = $emergencyEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide.
|
||||
*
|
||||
* @param bool $autoCorrectAddress Whether we should automatically correct the
|
||||
* address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAutoCorrectAddress(bool $autoCorrectAddress): self {
|
||||
$this->options['autoCorrectAddress'] = $autoCorrectAddress;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The additional number and street address of the address.
|
||||
*
|
||||
* @param string $streetSecondary The additional number and street address of
|
||||
* the address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStreetSecondary(string $streetSecondary): self {
|
||||
$this->options['streetSecondary'] = $streetSecondary;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.CreateAddressOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateAddressOptions extends Options {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @param string $customerName The name to associate with the address
|
||||
* @param string $street The number and street address of the address
|
||||
* @param string $city The city of the address
|
||||
* @param string $region The state or region of the address
|
||||
* @param string $postalCode The postal code of the address
|
||||
* @param bool $emergencyEnabled Whether to enable emergency calling on the
|
||||
* address
|
||||
* @param bool $autoCorrectAddress Whether we should automatically correct the
|
||||
* address
|
||||
* @param string $streetSecondary The additional number and street address of
|
||||
* the address
|
||||
*/
|
||||
public function __construct(string $friendlyName = Values::NONE, string $customerName = Values::NONE, string $street = Values::NONE, string $city = Values::NONE, string $region = Values::NONE, string $postalCode = Values::NONE, bool $emergencyEnabled = Values::NONE, bool $autoCorrectAddress = Values::NONE, string $streetSecondary = Values::NONE) {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
$this->options['customerName'] = $customerName;
|
||||
$this->options['street'] = $street;
|
||||
$this->options['city'] = $city;
|
||||
$this->options['region'] = $region;
|
||||
$this->options['postalCode'] = $postalCode;
|
||||
$this->options['emergencyEnabled'] = $emergencyEnabled;
|
||||
$this->options['autoCorrectAddress'] = $autoCorrectAddress;
|
||||
$this->options['streetSecondary'] = $streetSecondary;
|
||||
}
|
||||
|
||||
/**
|
||||
* A descriptive string that you create to describe the address. It can be up to 64 characters long.
|
||||
*
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name to associate with the address.
|
||||
*
|
||||
* @param string $customerName The name to associate with the address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setCustomerName(string $customerName): self {
|
||||
$this->options['customerName'] = $customerName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number and street address of the address.
|
||||
*
|
||||
* @param string $street The number and street address of the address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStreet(string $street): self {
|
||||
$this->options['street'] = $street;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The city of the address.
|
||||
*
|
||||
* @param string $city The city of the address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setCity(string $city): self {
|
||||
$this->options['city'] = $city;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state or region of the address.
|
||||
*
|
||||
* @param string $region The state or region of the address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setRegion(string $region): self {
|
||||
$this->options['region'] = $region;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The postal code of the address.
|
||||
*
|
||||
* @param string $postalCode The postal code of the address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setPostalCode(string $postalCode): self {
|
||||
$this->options['postalCode'] = $postalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to enable emergency calling on the address. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $emergencyEnabled Whether to enable emergency calling on the
|
||||
* address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setEmergencyEnabled(bool $emergencyEnabled): self {
|
||||
$this->options['emergencyEnabled'] = $emergencyEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide.
|
||||
*
|
||||
* @param bool $autoCorrectAddress Whether we should automatically correct the
|
||||
* address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAutoCorrectAddress(bool $autoCorrectAddress): self {
|
||||
$this->options['autoCorrectAddress'] = $autoCorrectAddress;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The additional number and street address of the address.
|
||||
*
|
||||
* @param string $streetSecondary The additional number and street address of
|
||||
* the address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStreetSecondary(string $streetSecondary): self {
|
||||
$this->options['streetSecondary'] = $streetSecondary;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.UpdateAddressOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
|
||||
class ReadAddressOptions extends Options {
|
||||
/**
|
||||
* @param string $customerName The `customer_name` of the Address resources to
|
||||
* read
|
||||
* @param string $friendlyName The string that identifies the Address resources
|
||||
* to read
|
||||
* @param string $isoCountry The ISO country code of the Address resources to
|
||||
* read
|
||||
*/
|
||||
public function __construct(string $customerName = Values::NONE, string $friendlyName = Values::NONE, string $isoCountry = Values::NONE) {
|
||||
$this->options['customerName'] = $customerName;
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
$this->options['isoCountry'] = $isoCountry;
|
||||
}
|
||||
|
||||
/**
|
||||
* The `customer_name` of the Address resources to read.
|
||||
*
|
||||
* @param string $customerName The `customer_name` of the Address resources to
|
||||
* read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setCustomerName(string $customerName): self {
|
||||
$this->options['customerName'] = $customerName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The string that identifies the Address resources to read.
|
||||
*
|
||||
* @param string $friendlyName The string that identifies the Address resources
|
||||
* to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The ISO country code of the Address resources to read.
|
||||
*
|
||||
* @param string $isoCountry The ISO country code of the Address resources to
|
||||
* read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setIsoCountry(string $isoCountry): self {
|
||||
$this->options['isoCountry'] = $isoCountry;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadAddressOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AddressPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class AddressPage 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 AddressInstance \Twilio\Rest\Api\V2010\Account\AddressInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): AddressInstance {
|
||||
return new AddressInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.AddressPage]';
|
||||
}
|
||||
}
|
||||
115
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php
vendored
Normal file
115
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class ApplicationContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the ApplicationContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* to fetch
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function __construct(Version $version, $accountSid, $sid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Applications/' . \rawurlencode($sid) . '.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the ApplicationInstance
|
||||
*
|
||||
* @return bool True if delete succeeds, false otherwise
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function delete(): bool {
|
||||
return $this->version->delete('DELETE', $this->uri);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the ApplicationInstance
|
||||
*
|
||||
* @return ApplicationInstance Fetched ApplicationInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): ApplicationInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new ApplicationInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the ApplicationInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return ApplicationInstance Updated ApplicationInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): ApplicationInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'FriendlyName' => $options['friendlyName'],
|
||||
'ApiVersion' => $options['apiVersion'],
|
||||
'VoiceUrl' => $options['voiceUrl'],
|
||||
'VoiceMethod' => $options['voiceMethod'],
|
||||
'VoiceFallbackUrl' => $options['voiceFallbackUrl'],
|
||||
'VoiceFallbackMethod' => $options['voiceFallbackMethod'],
|
||||
'StatusCallback' => $options['statusCallback'],
|
||||
'StatusCallbackMethod' => $options['statusCallbackMethod'],
|
||||
'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']),
|
||||
'SmsUrl' => $options['smsUrl'],
|
||||
'SmsMethod' => $options['smsMethod'],
|
||||
'SmsFallbackUrl' => $options['smsFallbackUrl'],
|
||||
'SmsFallbackMethod' => $options['smsFallbackMethod'],
|
||||
'SmsStatusCallback' => $options['smsStatusCallback'],
|
||||
'MessageStatusCallback' => $options['messageStatusCallback'],
|
||||
'PublicApplicationConnectEnabled' => Serialize::booleanToString($options['publicApplicationConnectEnabled']),
|
||||
]);
|
||||
|
||||
$payload = $this->version->update('POST', $this->uri, [], $data);
|
||||
|
||||
return new ApplicationInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$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.Api.V2010.ApplicationContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
163
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php
vendored
Normal file
163
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property string $apiVersion
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $friendlyName
|
||||
* @property string $messageStatusCallback
|
||||
* @property string $sid
|
||||
* @property string $smsFallbackMethod
|
||||
* @property string $smsFallbackUrl
|
||||
* @property string $smsMethod
|
||||
* @property string $smsStatusCallback
|
||||
* @property string $smsUrl
|
||||
* @property string $statusCallback
|
||||
* @property string $statusCallbackMethod
|
||||
* @property string $uri
|
||||
* @property bool $voiceCallerIdLookup
|
||||
* @property string $voiceFallbackMethod
|
||||
* @property string $voiceFallbackUrl
|
||||
* @property string $voiceMethod
|
||||
* @property string $voiceUrl
|
||||
* @property bool $publicApplicationConnectEnabled
|
||||
*/
|
||||
class ApplicationInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the ApplicationInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'apiVersion' => Values::array_get($payload, 'api_version'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'messageStatusCallback' => Values::array_get($payload, 'message_status_callback'),
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'),
|
||||
'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'),
|
||||
'smsMethod' => Values::array_get($payload, 'sms_method'),
|
||||
'smsStatusCallback' => Values::array_get($payload, 'sms_status_callback'),
|
||||
'smsUrl' => Values::array_get($payload, 'sms_url'),
|
||||
'statusCallback' => Values::array_get($payload, 'status_callback'),
|
||||
'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'),
|
||||
'uri' => Values::array_get($payload, 'uri'),
|
||||
'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'),
|
||||
'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'),
|
||||
'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'),
|
||||
'voiceMethod' => Values::array_get($payload, 'voice_method'),
|
||||
'voiceUrl' => Values::array_get($payload, 'voice_url'),
|
||||
'publicApplicationConnectEnabled' => Values::array_get($payload, 'public_application_connect_enabled'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return ApplicationContext Context for this ApplicationInstance
|
||||
*/
|
||||
protected function proxy(): ApplicationContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new ApplicationContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the ApplicationInstance
|
||||
*
|
||||
* @return bool True if delete succeeds, false otherwise
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function delete(): bool {
|
||||
return $this->proxy()->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the ApplicationInstance
|
||||
*
|
||||
* @return ApplicationInstance Fetched ApplicationInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): ApplicationInstance {
|
||||
return $this->proxy()->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the ApplicationInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return ApplicationInstance Updated ApplicationInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): ApplicationInstance {
|
||||
return $this->proxy()->update($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(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.Api.V2010.ApplicationInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
175
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationList.php
vendored
Normal file
175
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationList.php
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class ApplicationList extends ListResource {
|
||||
/**
|
||||
* Construct the ApplicationList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Applications.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the ApplicationInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return ApplicationInstance Created ApplicationInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(array $options = []): ApplicationInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'ApiVersion' => $options['apiVersion'],
|
||||
'VoiceUrl' => $options['voiceUrl'],
|
||||
'VoiceMethod' => $options['voiceMethod'],
|
||||
'VoiceFallbackUrl' => $options['voiceFallbackUrl'],
|
||||
'VoiceFallbackMethod' => $options['voiceFallbackMethod'],
|
||||
'StatusCallback' => $options['statusCallback'],
|
||||
'StatusCallbackMethod' => $options['statusCallbackMethod'],
|
||||
'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']),
|
||||
'SmsUrl' => $options['smsUrl'],
|
||||
'SmsMethod' => $options['smsMethod'],
|
||||
'SmsFallbackUrl' => $options['smsFallbackUrl'],
|
||||
'SmsFallbackMethod' => $options['smsFallbackMethod'],
|
||||
'SmsStatusCallback' => $options['smsStatusCallback'],
|
||||
'MessageStatusCallback' => $options['messageStatusCallback'],
|
||||
'FriendlyName' => $options['friendlyName'],
|
||||
'PublicApplicationConnectEnabled' => Serialize::booleanToString($options['publicApplicationConnectEnabled']),
|
||||
]);
|
||||
|
||||
$payload = $this->version->create('POST', $this->uri, [], $data);
|
||||
|
||||
return new ApplicationInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams ApplicationInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads ApplicationInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return ApplicationInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of ApplicationInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 ApplicationPage Page of ApplicationInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): ApplicationPage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'FriendlyName' => $options['friendlyName'],
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new ApplicationPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of ApplicationInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return ApplicationPage Page of ApplicationInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): ApplicationPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new ApplicationPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a ApplicationContext
|
||||
*
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function getContext(string $sid): ApplicationContext {
|
||||
return new ApplicationContext($this->version, $this->solution['accountSid'], $sid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.ApplicationList]';
|
||||
}
|
||||
}
|
||||
609
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php
vendored
Normal file
609
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php
vendored
Normal file
@@ -0,0 +1,609 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class ApplicationOptions {
|
||||
/**
|
||||
* @param string $apiVersion The API version to use to start a new TwiML session
|
||||
* @param string $voiceUrl The URL to call when the phone number receives a call
|
||||
* @param string $voiceMethod The HTTP method to use with the voice_url
|
||||
* @param string $voiceFallbackUrl The URL to call when a TwiML error occurs
|
||||
* @param string $voiceFallbackMethod The HTTP method to use with
|
||||
* voice_fallback_url
|
||||
* @param string $statusCallback The URL to send status information to your
|
||||
* application
|
||||
* @param string $statusCallbackMethod The HTTP method to use to call
|
||||
* status_callback
|
||||
* @param bool $voiceCallerIdLookup Whether to lookup the caller's name
|
||||
* @param string $smsUrl The URL to call when the phone number receives an
|
||||
* incoming SMS message
|
||||
* @param string $smsMethod The HTTP method to use with sms_url
|
||||
* @param string $smsFallbackUrl The URL to call when an error occurs while
|
||||
* retrieving or executing the TwiML
|
||||
* @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url
|
||||
* @param string $smsStatusCallback The URL to send status information to your
|
||||
* application
|
||||
* @param string $messageStatusCallback The URL to send message status
|
||||
* information to your application
|
||||
* @param string $friendlyName A string to describe the new resource
|
||||
* @param bool $publicApplicationConnectEnabled Whether to allow other Twilio
|
||||
* accounts to dial this
|
||||
* application
|
||||
* @return CreateApplicationOptions Options builder
|
||||
*/
|
||||
public static function create(string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, string $friendlyName = Values::NONE, bool $publicApplicationConnectEnabled = Values::NONE): CreateApplicationOptions {
|
||||
return new CreateApplicationOptions($apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback, $friendlyName, $publicApplicationConnectEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $friendlyName The string that identifies the Application
|
||||
* resources to read
|
||||
* @return ReadApplicationOptions Options builder
|
||||
*/
|
||||
public static function read(string $friendlyName = Values::NONE): ReadApplicationOptions {
|
||||
return new ReadApplicationOptions($friendlyName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @param string $apiVersion The API version to use to start a new TwiML session
|
||||
* @param string $voiceUrl The URL to call when the phone number receives a call
|
||||
* @param string $voiceMethod The HTTP method to use with the voice_url
|
||||
* @param string $voiceFallbackUrl The URL to call when a TwiML error occurs
|
||||
* @param string $voiceFallbackMethod The HTTP method to use with
|
||||
* voice_fallback_url
|
||||
* @param string $statusCallback The URL to send status information to your
|
||||
* application
|
||||
* @param string $statusCallbackMethod The HTTP method to use to call
|
||||
* status_callback
|
||||
* @param bool $voiceCallerIdLookup Whether to lookup the caller's name
|
||||
* @param string $smsUrl The URL to call when the phone number receives an
|
||||
* incoming SMS message
|
||||
* @param string $smsMethod The HTTP method to use with sms_url
|
||||
* @param string $smsFallbackUrl The URL to call when an error occurs while
|
||||
* retrieving or executing the TwiML
|
||||
* @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url
|
||||
* @param string $smsStatusCallback Same as message_status_callback.
|
||||
* Deprecated, included for backwards
|
||||
* compatibility.
|
||||
* @param string $messageStatusCallback The URL to send message status
|
||||
* information to your application
|
||||
* @param bool $publicApplicationConnectEnabled Whether to allow other Twilio
|
||||
* accounts to dial this
|
||||
* application
|
||||
* @return UpdateApplicationOptions Options builder
|
||||
*/
|
||||
public static function update(string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, bool $publicApplicationConnectEnabled = Values::NONE): UpdateApplicationOptions {
|
||||
return new UpdateApplicationOptions($friendlyName, $apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback, $publicApplicationConnectEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
class CreateApplicationOptions extends Options {
|
||||
/**
|
||||
* @param string $apiVersion The API version to use to start a new TwiML session
|
||||
* @param string $voiceUrl The URL to call when the phone number receives a call
|
||||
* @param string $voiceMethod The HTTP method to use with the voice_url
|
||||
* @param string $voiceFallbackUrl The URL to call when a TwiML error occurs
|
||||
* @param string $voiceFallbackMethod The HTTP method to use with
|
||||
* voice_fallback_url
|
||||
* @param string $statusCallback The URL to send status information to your
|
||||
* application
|
||||
* @param string $statusCallbackMethod The HTTP method to use to call
|
||||
* status_callback
|
||||
* @param bool $voiceCallerIdLookup Whether to lookup the caller's name
|
||||
* @param string $smsUrl The URL to call when the phone number receives an
|
||||
* incoming SMS message
|
||||
* @param string $smsMethod The HTTP method to use with sms_url
|
||||
* @param string $smsFallbackUrl The URL to call when an error occurs while
|
||||
* retrieving or executing the TwiML
|
||||
* @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url
|
||||
* @param string $smsStatusCallback The URL to send status information to your
|
||||
* application
|
||||
* @param string $messageStatusCallback The URL to send message status
|
||||
* information to your application
|
||||
* @param string $friendlyName A string to describe the new resource
|
||||
* @param bool $publicApplicationConnectEnabled Whether to allow other Twilio
|
||||
* accounts to dial this
|
||||
* application
|
||||
*/
|
||||
public function __construct(string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, string $friendlyName = Values::NONE, bool $publicApplicationConnectEnabled = Values::NONE) {
|
||||
$this->options['apiVersion'] = $apiVersion;
|
||||
$this->options['voiceUrl'] = $voiceUrl;
|
||||
$this->options['voiceMethod'] = $voiceMethod;
|
||||
$this->options['voiceFallbackUrl'] = $voiceFallbackUrl;
|
||||
$this->options['voiceFallbackMethod'] = $voiceFallbackMethod;
|
||||
$this->options['statusCallback'] = $statusCallback;
|
||||
$this->options['statusCallbackMethod'] = $statusCallbackMethod;
|
||||
$this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup;
|
||||
$this->options['smsUrl'] = $smsUrl;
|
||||
$this->options['smsMethod'] = $smsMethod;
|
||||
$this->options['smsFallbackUrl'] = $smsFallbackUrl;
|
||||
$this->options['smsFallbackMethod'] = $smsFallbackMethod;
|
||||
$this->options['smsStatusCallback'] = $smsStatusCallback;
|
||||
$this->options['messageStatusCallback'] = $messageStatusCallback;
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
$this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version.
|
||||
*
|
||||
* @param string $apiVersion The API version to use to start a new TwiML session
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setApiVersion(string $apiVersion): self {
|
||||
$this->options['apiVersion'] = $apiVersion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call when the phone number assigned to this application receives a call.
|
||||
*
|
||||
* @param string $voiceUrl The URL to call when the phone number receives a call
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceUrl(string $voiceUrl): self {
|
||||
$this->options['voiceUrl'] = $voiceUrl;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $voiceMethod The HTTP method to use with the voice_url
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceMethod(string $voiceMethod): self {
|
||||
$this->options['voiceMethod'] = $voiceMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`.
|
||||
*
|
||||
* @param string $voiceFallbackUrl The URL to call when a TwiML error occurs
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceFallbackUrl(string $voiceFallbackUrl): self {
|
||||
$this->options['voiceFallbackUrl'] = $voiceFallbackUrl;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $voiceFallbackMethod The HTTP method to use with
|
||||
* voice_fallback_url
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceFallbackMethod(string $voiceFallbackMethod): self {
|
||||
$this->options['voiceFallbackMethod'] = $voiceFallbackMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call using the `status_callback_method` to send status information to your application.
|
||||
*
|
||||
* @param string $statusCallback The URL to send status information to your
|
||||
* application
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStatusCallback(string $statusCallback): self {
|
||||
$this->options['statusCallback'] = $statusCallback;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $statusCallbackMethod The HTTP method to use to call
|
||||
* status_callback
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStatusCallbackMethod(string $statusCallbackMethod): self {
|
||||
$this->options['statusCallbackMethod'] = $statusCallbackMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceCallerIdLookup Whether to lookup the caller's name
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self {
|
||||
$this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call when the phone number receives an incoming SMS message.
|
||||
*
|
||||
* @param string $smsUrl The URL to call when the phone number receives an
|
||||
* incoming SMS message
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsUrl(string $smsUrl): self {
|
||||
$this->options['smsUrl'] = $smsUrl;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $smsMethod The HTTP method to use with sms_url
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsMethod(string $smsMethod): self {
|
||||
$this->options['smsMethod'] = $smsMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`.
|
||||
*
|
||||
* @param string $smsFallbackUrl The URL to call when an error occurs while
|
||||
* retrieving or executing the TwiML
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsFallbackUrl(string $smsFallbackUrl): self {
|
||||
$this->options['smsFallbackUrl'] = $smsFallbackUrl;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsFallbackMethod(string $smsFallbackMethod): self {
|
||||
$this->options['smsFallbackMethod'] = $smsFallbackMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call using a POST method to send status information about SMS messages sent by the application.
|
||||
*
|
||||
* @param string $smsStatusCallback The URL to send status information to your
|
||||
* application
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsStatusCallback(string $smsStatusCallback): self {
|
||||
$this->options['smsStatusCallback'] = $smsStatusCallback;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call using a POST method to send message status information to your application.
|
||||
*
|
||||
* @param string $messageStatusCallback The URL to send message status
|
||||
* information to your application
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMessageStatusCallback(string $messageStatusCallback): self {
|
||||
$this->options['messageStatusCallback'] = $messageStatusCallback;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A descriptive string that you create to describe the new application. It can be up to 64 characters long.
|
||||
*
|
||||
* @param string $friendlyName A string to describe the new resource
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $publicApplicationConnectEnabled Whether to allow other Twilio
|
||||
* accounts to dial this
|
||||
* application
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self {
|
||||
$this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.CreateApplicationOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
|
||||
class ReadApplicationOptions extends Options {
|
||||
/**
|
||||
* @param string $friendlyName The string that identifies the Application
|
||||
* resources to read
|
||||
*/
|
||||
public function __construct(string $friendlyName = Values::NONE) {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
}
|
||||
|
||||
/**
|
||||
* The string that identifies the Application resources to read.
|
||||
*
|
||||
* @param string $friendlyName The string that identifies the Application
|
||||
* resources to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadApplicationOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateApplicationOptions extends Options {
|
||||
/**
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @param string $apiVersion The API version to use to start a new TwiML session
|
||||
* @param string $voiceUrl The URL to call when the phone number receives a call
|
||||
* @param string $voiceMethod The HTTP method to use with the voice_url
|
||||
* @param string $voiceFallbackUrl The URL to call when a TwiML error occurs
|
||||
* @param string $voiceFallbackMethod The HTTP method to use with
|
||||
* voice_fallback_url
|
||||
* @param string $statusCallback The URL to send status information to your
|
||||
* application
|
||||
* @param string $statusCallbackMethod The HTTP method to use to call
|
||||
* status_callback
|
||||
* @param bool $voiceCallerIdLookup Whether to lookup the caller's name
|
||||
* @param string $smsUrl The URL to call when the phone number receives an
|
||||
* incoming SMS message
|
||||
* @param string $smsMethod The HTTP method to use with sms_url
|
||||
* @param string $smsFallbackUrl The URL to call when an error occurs while
|
||||
* retrieving or executing the TwiML
|
||||
* @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url
|
||||
* @param string $smsStatusCallback Same as message_status_callback.
|
||||
* Deprecated, included for backwards
|
||||
* compatibility.
|
||||
* @param string $messageStatusCallback The URL to send message status
|
||||
* information to your application
|
||||
* @param bool $publicApplicationConnectEnabled Whether to allow other Twilio
|
||||
* accounts to dial this
|
||||
* application
|
||||
*/
|
||||
public function __construct(string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, bool $publicApplicationConnectEnabled = Values::NONE) {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
$this->options['apiVersion'] = $apiVersion;
|
||||
$this->options['voiceUrl'] = $voiceUrl;
|
||||
$this->options['voiceMethod'] = $voiceMethod;
|
||||
$this->options['voiceFallbackUrl'] = $voiceFallbackUrl;
|
||||
$this->options['voiceFallbackMethod'] = $voiceFallbackMethod;
|
||||
$this->options['statusCallback'] = $statusCallback;
|
||||
$this->options['statusCallbackMethod'] = $statusCallbackMethod;
|
||||
$this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup;
|
||||
$this->options['smsUrl'] = $smsUrl;
|
||||
$this->options['smsMethod'] = $smsMethod;
|
||||
$this->options['smsFallbackUrl'] = $smsFallbackUrl;
|
||||
$this->options['smsFallbackMethod'] = $smsFallbackMethod;
|
||||
$this->options['smsStatusCallback'] = $smsStatusCallback;
|
||||
$this->options['messageStatusCallback'] = $messageStatusCallback;
|
||||
$this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* A descriptive string that you create to describe the resource. It can be up to 64 characters long.
|
||||
*
|
||||
* @param string $friendlyName A string to describe the resource
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFriendlyName(string $friendlyName): self {
|
||||
$this->options['friendlyName'] = $friendlyName;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version.
|
||||
*
|
||||
* @param string $apiVersion The API version to use to start a new TwiML session
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setApiVersion(string $apiVersion): self {
|
||||
$this->options['apiVersion'] = $apiVersion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call when the phone number assigned to this application receives a call.
|
||||
*
|
||||
* @param string $voiceUrl The URL to call when the phone number receives a call
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceUrl(string $voiceUrl): self {
|
||||
$this->options['voiceUrl'] = $voiceUrl;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $voiceMethod The HTTP method to use with the voice_url
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceMethod(string $voiceMethod): self {
|
||||
$this->options['voiceMethod'] = $voiceMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`.
|
||||
*
|
||||
* @param string $voiceFallbackUrl The URL to call when a TwiML error occurs
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceFallbackUrl(string $voiceFallbackUrl): self {
|
||||
$this->options['voiceFallbackUrl'] = $voiceFallbackUrl;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $voiceFallbackMethod The HTTP method to use with
|
||||
* voice_fallback_url
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceFallbackMethod(string $voiceFallbackMethod): self {
|
||||
$this->options['voiceFallbackMethod'] = $voiceFallbackMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call using the `status_callback_method` to send status information to your application.
|
||||
*
|
||||
* @param string $statusCallback The URL to send status information to your
|
||||
* application
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStatusCallback(string $statusCallback): self {
|
||||
$this->options['statusCallback'] = $statusCallback;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $statusCallbackMethod The HTTP method to use to call
|
||||
* status_callback
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStatusCallbackMethod(string $statusCallbackMethod): self {
|
||||
$this->options['statusCallbackMethod'] = $statusCallbackMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceCallerIdLookup Whether to lookup the caller's name
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self {
|
||||
$this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call when the phone number receives an incoming SMS message.
|
||||
*
|
||||
* @param string $smsUrl The URL to call when the phone number receives an
|
||||
* incoming SMS message
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsUrl(string $smsUrl): self {
|
||||
$this->options['smsUrl'] = $smsUrl;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $smsMethod The HTTP method to use with sms_url
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsMethod(string $smsMethod): self {
|
||||
$this->options['smsMethod'] = $smsMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`.
|
||||
*
|
||||
* @param string $smsFallbackUrl The URL to call when an error occurs while
|
||||
* retrieving or executing the TwiML
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsFallbackUrl(string $smsFallbackUrl): self {
|
||||
$this->options['smsFallbackUrl'] = $smsFallbackUrl;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`.
|
||||
*
|
||||
* @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsFallbackMethod(string $smsFallbackMethod): self {
|
||||
$this->options['smsFallbackMethod'] = $smsFallbackMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility.
|
||||
*
|
||||
* @param string $smsStatusCallback Same as message_status_callback.
|
||||
* Deprecated, included for backwards
|
||||
* compatibility.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsStatusCallback(string $smsStatusCallback): self {
|
||||
$this->options['smsStatusCallback'] = $smsStatusCallback;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL we should call using a POST method to send message status information to your application.
|
||||
*
|
||||
* @param string $messageStatusCallback The URL to send message status
|
||||
* information to your application
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMessageStatusCallback(string $messageStatusCallback): self {
|
||||
$this->options['messageStatusCallback'] = $messageStatusCallback;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $publicApplicationConnectEnabled Whether to allow other Twilio
|
||||
* accounts to dial this
|
||||
* application
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self {
|
||||
$this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.UpdateApplicationOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class ApplicationPage 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 ApplicationInstance \Twilio\Rest\Api\V2010\Account\ApplicationInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): ApplicationInstance {
|
||||
return new ApplicationInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.ApplicationPage]';
|
||||
}
|
||||
}
|
||||
64
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php
vendored
Normal file
64
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class AuthorizedConnectAppContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the AuthorizedConnectAppContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* to fetch
|
||||
* @param string $connectAppSid The SID of the Connect App to fetch
|
||||
*/
|
||||
public function __construct(Version $version, $accountSid, $connectAppSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'connectAppSid' => $connectAppSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AuthorizedConnectApps/' . \rawurlencode($connectAppSid) . '.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the AuthorizedConnectAppInstance
|
||||
*
|
||||
* @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): AuthorizedConnectAppInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new AuthorizedConnectAppInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['connectAppSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.AuthorizedConnectAppContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
123
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php
vendored
Normal file
123
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property string $connectAppCompanyName
|
||||
* @property string $connectAppDescription
|
||||
* @property string $connectAppFriendlyName
|
||||
* @property string $connectAppHomepageUrl
|
||||
* @property string $connectAppSid
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string[] $permissions
|
||||
* @property string $uri
|
||||
*/
|
||||
class AuthorizedConnectAppInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the AuthorizedConnectAppInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* @param string $connectAppSid The SID of the Connect App to fetch
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $connectAppSid = null) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'connectAppCompanyName' => Values::array_get($payload, 'connect_app_company_name'),
|
||||
'connectAppDescription' => Values::array_get($payload, 'connect_app_description'),
|
||||
'connectAppFriendlyName' => Values::array_get($payload, 'connect_app_friendly_name'),
|
||||
'connectAppHomepageUrl' => Values::array_get($payload, 'connect_app_homepage_url'),
|
||||
'connectAppSid' => Values::array_get($payload, 'connect_app_sid'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'permissions' => Values::array_get($payload, 'permissions'),
|
||||
'uri' => Values::array_get($payload, 'uri'),
|
||||
];
|
||||
|
||||
$this->solution = [
|
||||
'accountSid' => $accountSid,
|
||||
'connectAppSid' => $connectAppSid ?: $this->properties['connectAppSid'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return AuthorizedConnectAppContext Context for this
|
||||
* AuthorizedConnectAppInstance
|
||||
*/
|
||||
protected function proxy(): AuthorizedConnectAppContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new AuthorizedConnectAppContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['connectAppSid']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the AuthorizedConnectAppInstance
|
||||
*
|
||||
* @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): AuthorizedConnectAppInstance {
|
||||
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.Api.V2010.AuthorizedConnectAppInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
134
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php
vendored
Normal file
134
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php
vendored
Normal file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class AuthorizedConnectAppList extends ListResource {
|
||||
/**
|
||||
* Construct the AuthorizedConnectAppList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AuthorizedConnectApps.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams AuthorizedConnectAppInstance 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 AuthorizedConnectAppInstance 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 AuthorizedConnectAppInstance[] 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 AuthorizedConnectAppInstance 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 AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance
|
||||
*/
|
||||
public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): AuthorizedConnectAppPage {
|
||||
$params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new AuthorizedConnectAppPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of AuthorizedConnectAppInstance records from the
|
||||
* API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): AuthorizedConnectAppPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new AuthorizedConnectAppPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a AuthorizedConnectAppContext
|
||||
*
|
||||
* @param string $connectAppSid The SID of the Connect App to fetch
|
||||
*/
|
||||
public function getContext(string $connectAppSid): AuthorizedConnectAppContext {
|
||||
return new AuthorizedConnectAppContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$connectAppSid
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.AuthorizedConnectAppList]';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class AuthorizedConnectAppPage 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 AuthorizedConnectAppInstance \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): AuthorizedConnectAppInstance {
|
||||
return new AuthorizedConnectAppInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.AuthorizedConnectAppPage]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $friendlyName
|
||||
* @property string $phoneNumber
|
||||
* @property string $lata
|
||||
* @property string $locality
|
||||
* @property string $rateCenter
|
||||
* @property string $latitude
|
||||
* @property string $longitude
|
||||
* @property string $region
|
||||
* @property string $postalCode
|
||||
* @property string $isoCountry
|
||||
* @property string $addressRequirements
|
||||
* @property bool $beta
|
||||
* @property string $capabilities
|
||||
*/
|
||||
class LocalInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the LocalInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'phoneNumber' => Values::array_get($payload, 'phone_number'),
|
||||
'lata' => Values::array_get($payload, 'lata'),
|
||||
'locality' => Values::array_get($payload, 'locality'),
|
||||
'rateCenter' => Values::array_get($payload, 'rate_center'),
|
||||
'latitude' => Values::array_get($payload, 'latitude'),
|
||||
'longitude' => Values::array_get($payload, 'longitude'),
|
||||
'region' => Values::array_get($payload, 'region'),
|
||||
'postalCode' => Values::array_get($payload, 'postal_code'),
|
||||
'isoCountry' => Values::array_get($payload, 'iso_country'),
|
||||
'addressRequirements' => Values::array_get($payload, 'address_requirements'),
|
||||
'beta' => Values::array_get($payload, 'beta'),
|
||||
'capabilities' => Values::array_get($payload, 'capabilities'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.LocalInstance]';
|
||||
}
|
||||
}
|
||||
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php
vendored
Normal file
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class LocalList extends ListResource {
|
||||
/**
|
||||
* Construct the LocalList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Local.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams LocalInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads LocalInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return LocalInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of LocalInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 LocalPage Page of LocalInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): LocalPage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'AreaCode' => $options['areaCode'],
|
||||
'Contains' => $options['contains'],
|
||||
'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']),
|
||||
'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']),
|
||||
'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']),
|
||||
'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']),
|
||||
'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']),
|
||||
'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']),
|
||||
'Beta' => Serialize::booleanToString($options['beta']),
|
||||
'NearNumber' => $options['nearNumber'],
|
||||
'NearLatLong' => $options['nearLatLong'],
|
||||
'Distance' => $options['distance'],
|
||||
'InPostalCode' => $options['inPostalCode'],
|
||||
'InRegion' => $options['inRegion'],
|
||||
'InRateCenter' => $options['inRateCenter'],
|
||||
'InLata' => $options['inLata'],
|
||||
'InLocality' => $options['inLocality'],
|
||||
'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']),
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new LocalPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of LocalInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return LocalPage Page of LocalInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): LocalPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new LocalPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.LocalList]';
|
||||
}
|
||||
}
|
||||
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php
vendored
Normal file
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class LocalOptions {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return ReadLocalOptions Options builder
|
||||
*/
|
||||
public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadLocalOptions {
|
||||
return new ReadLocalOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
class ReadLocalOptions extends Options {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
*/
|
||||
public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
$this->options['contains'] = $contains;
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
$this->options['beta'] = $beta;
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
$this->options['distance'] = $distance;
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
$this->options['inLata'] = $inLata;
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAreaCode(int $areaCode): self {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters.
|
||||
*
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setContains(string $contains): self {
|
||||
$this->options['contains'] = $contains;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive text messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsEnabled(bool $smsEnabled): self {
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMmsEnabled(bool $mmsEnabled): self {
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive calls. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceEnabled(bool $voiceEnabled): self {
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self {
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self {
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self {
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.
|
||||
*
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setBeta(bool $beta): self {
|
||||
$this->options['beta'] = $beta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearNumber(string $nearNumber): self {
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearLatLong(string $nearLatLong): self {
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setDistance(int $distance): self {
|
||||
$this->options['distance'] = $distance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInPostalCode(string $inPostalCode): self {
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRegion(string $inRegion): self {
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRateCenter(string $inRateCenter): self {
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLata(string $inLata): self {
|
||||
$this->options['inLata'] = $inLata;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
|
||||
*
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLocality(string $inLocality): self {
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive faxes. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFaxEnabled(bool $faxEnabled): self {
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class LocalPage 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 LocalInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): LocalInstance {
|
||||
return new LocalInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.LocalPage]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $friendlyName
|
||||
* @property string $phoneNumber
|
||||
* @property string $lata
|
||||
* @property string $locality
|
||||
* @property string $rateCenter
|
||||
* @property string $latitude
|
||||
* @property string $longitude
|
||||
* @property string $region
|
||||
* @property string $postalCode
|
||||
* @property string $isoCountry
|
||||
* @property string $addressRequirements
|
||||
* @property bool $beta
|
||||
* @property string $capabilities
|
||||
*/
|
||||
class MachineToMachineInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the MachineToMachineInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'phoneNumber' => Values::array_get($payload, 'phone_number'),
|
||||
'lata' => Values::array_get($payload, 'lata'),
|
||||
'locality' => Values::array_get($payload, 'locality'),
|
||||
'rateCenter' => Values::array_get($payload, 'rate_center'),
|
||||
'latitude' => Values::array_get($payload, 'latitude'),
|
||||
'longitude' => Values::array_get($payload, 'longitude'),
|
||||
'region' => Values::array_get($payload, 'region'),
|
||||
'postalCode' => Values::array_get($payload, 'postal_code'),
|
||||
'isoCountry' => Values::array_get($payload, 'iso_country'),
|
||||
'addressRequirements' => Values::array_get($payload, 'address_requirements'),
|
||||
'beta' => Values::array_get($payload, 'beta'),
|
||||
'capabilities' => Values::array_get($payload, 'capabilities'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.MachineToMachineInstance]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class MachineToMachineList extends ListResource {
|
||||
/**
|
||||
* Construct the MachineToMachineList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/MachineToMachine.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams MachineToMachineInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads MachineToMachineInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return MachineToMachineInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of MachineToMachineInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 MachineToMachinePage Page of MachineToMachineInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): MachineToMachinePage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'AreaCode' => $options['areaCode'],
|
||||
'Contains' => $options['contains'],
|
||||
'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']),
|
||||
'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']),
|
||||
'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']),
|
||||
'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']),
|
||||
'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']),
|
||||
'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']),
|
||||
'Beta' => Serialize::booleanToString($options['beta']),
|
||||
'NearNumber' => $options['nearNumber'],
|
||||
'NearLatLong' => $options['nearLatLong'],
|
||||
'Distance' => $options['distance'],
|
||||
'InPostalCode' => $options['inPostalCode'],
|
||||
'InRegion' => $options['inRegion'],
|
||||
'InRateCenter' => $options['inRateCenter'],
|
||||
'InLata' => $options['inLata'],
|
||||
'InLocality' => $options['inLocality'],
|
||||
'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']),
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new MachineToMachinePage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of MachineToMachineInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return MachineToMachinePage Page of MachineToMachineInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): MachineToMachinePage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new MachineToMachinePage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.MachineToMachineList]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class MachineToMachineOptions {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return ReadMachineToMachineOptions Options builder
|
||||
*/
|
||||
public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadMachineToMachineOptions {
|
||||
return new ReadMachineToMachineOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
class ReadMachineToMachineOptions extends Options {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
*/
|
||||
public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
$this->options['contains'] = $contains;
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
$this->options['beta'] = $beta;
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
$this->options['distance'] = $distance;
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
$this->options['inLata'] = $inLata;
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAreaCode(int $areaCode): self {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
||||
*
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setContains(string $contains): self {
|
||||
$this->options['contains'] = $contains;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive text messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsEnabled(bool $smsEnabled): self {
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMmsEnabled(bool $mmsEnabled): self {
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive calls. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceEnabled(bool $voiceEnabled): self {
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self {
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self {
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self {
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.
|
||||
*
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setBeta(bool $beta): self {
|
||||
$this->options['beta'] = $beta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearNumber(string $nearNumber): self {
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearLatLong(string $nearLatLong): self {
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setDistance(int $distance): self {
|
||||
$this->options['distance'] = $distance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInPostalCode(string $inPostalCode): self {
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRegion(string $inRegion): self {
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRateCenter(string $inRateCenter): self {
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLata(string $inLata): self {
|
||||
$this->options['inLata'] = $inLata;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
|
||||
*
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLocality(string $inLocality): self {
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive faxes. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFaxEnabled(bool $faxEnabled): self {
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadMachineToMachineOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class MachineToMachinePage 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 MachineToMachineInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): MachineToMachineInstance {
|
||||
return new MachineToMachineInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.MachineToMachinePage]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $friendlyName
|
||||
* @property string $phoneNumber
|
||||
* @property string $lata
|
||||
* @property string $locality
|
||||
* @property string $rateCenter
|
||||
* @property string $latitude
|
||||
* @property string $longitude
|
||||
* @property string $region
|
||||
* @property string $postalCode
|
||||
* @property string $isoCountry
|
||||
* @property string $addressRequirements
|
||||
* @property bool $beta
|
||||
* @property string $capabilities
|
||||
*/
|
||||
class MobileInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the MobileInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'phoneNumber' => Values::array_get($payload, 'phone_number'),
|
||||
'lata' => Values::array_get($payload, 'lata'),
|
||||
'locality' => Values::array_get($payload, 'locality'),
|
||||
'rateCenter' => Values::array_get($payload, 'rate_center'),
|
||||
'latitude' => Values::array_get($payload, 'latitude'),
|
||||
'longitude' => Values::array_get($payload, 'longitude'),
|
||||
'region' => Values::array_get($payload, 'region'),
|
||||
'postalCode' => Values::array_get($payload, 'postal_code'),
|
||||
'isoCountry' => Values::array_get($payload, 'iso_country'),
|
||||
'addressRequirements' => Values::array_get($payload, 'address_requirements'),
|
||||
'beta' => Values::array_get($payload, 'beta'),
|
||||
'capabilities' => Values::array_get($payload, 'capabilities'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.MobileInstance]';
|
||||
}
|
||||
}
|
||||
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php
vendored
Normal file
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class MobileList extends ListResource {
|
||||
/**
|
||||
* Construct the MobileList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Mobile.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams MobileInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads MobileInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return MobileInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of MobileInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 MobilePage Page of MobileInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): MobilePage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'AreaCode' => $options['areaCode'],
|
||||
'Contains' => $options['contains'],
|
||||
'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']),
|
||||
'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']),
|
||||
'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']),
|
||||
'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']),
|
||||
'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']),
|
||||
'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']),
|
||||
'Beta' => Serialize::booleanToString($options['beta']),
|
||||
'NearNumber' => $options['nearNumber'],
|
||||
'NearLatLong' => $options['nearLatLong'],
|
||||
'Distance' => $options['distance'],
|
||||
'InPostalCode' => $options['inPostalCode'],
|
||||
'InRegion' => $options['inRegion'],
|
||||
'InRateCenter' => $options['inRateCenter'],
|
||||
'InLata' => $options['inLata'],
|
||||
'InLocality' => $options['inLocality'],
|
||||
'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']),
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new MobilePage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of MobileInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return MobilePage Page of MobileInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): MobilePage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new MobilePage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.MobileList]';
|
||||
}
|
||||
}
|
||||
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php
vendored
Normal file
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class MobileOptions {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return ReadMobileOptions Options builder
|
||||
*/
|
||||
public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadMobileOptions {
|
||||
return new ReadMobileOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
class ReadMobileOptions extends Options {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
*/
|
||||
public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
$this->options['contains'] = $contains;
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
$this->options['beta'] = $beta;
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
$this->options['distance'] = $distance;
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
$this->options['inLata'] = $inLata;
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAreaCode(int $areaCode): self {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
||||
*
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setContains(string $contains): self {
|
||||
$this->options['contains'] = $contains;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive text messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsEnabled(bool $smsEnabled): self {
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMmsEnabled(bool $mmsEnabled): self {
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive calls. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceEnabled(bool $voiceEnabled): self {
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self {
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self {
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self {
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.
|
||||
*
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setBeta(bool $beta): self {
|
||||
$this->options['beta'] = $beta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearNumber(string $nearNumber): self {
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearLatLong(string $nearLatLong): self {
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setDistance(int $distance): self {
|
||||
$this->options['distance'] = $distance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInPostalCode(string $inPostalCode): self {
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRegion(string $inRegion): self {
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRateCenter(string $inRateCenter): self {
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLata(string $inLata): self {
|
||||
$this->options['inLata'] = $inLata;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
|
||||
*
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLocality(string $inLocality): self {
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive faxes. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFaxEnabled(bool $faxEnabled): self {
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class MobilePage 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 MobileInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): MobileInstance {
|
||||
return new MobileInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.MobilePage]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $friendlyName
|
||||
* @property string $phoneNumber
|
||||
* @property string $lata
|
||||
* @property string $locality
|
||||
* @property string $rateCenter
|
||||
* @property string $latitude
|
||||
* @property string $longitude
|
||||
* @property string $region
|
||||
* @property string $postalCode
|
||||
* @property string $isoCountry
|
||||
* @property string $addressRequirements
|
||||
* @property bool $beta
|
||||
* @property string $capabilities
|
||||
*/
|
||||
class NationalInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the NationalInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'phoneNumber' => Values::array_get($payload, 'phone_number'),
|
||||
'lata' => Values::array_get($payload, 'lata'),
|
||||
'locality' => Values::array_get($payload, 'locality'),
|
||||
'rateCenter' => Values::array_get($payload, 'rate_center'),
|
||||
'latitude' => Values::array_get($payload, 'latitude'),
|
||||
'longitude' => Values::array_get($payload, 'longitude'),
|
||||
'region' => Values::array_get($payload, 'region'),
|
||||
'postalCode' => Values::array_get($payload, 'postal_code'),
|
||||
'isoCountry' => Values::array_get($payload, 'iso_country'),
|
||||
'addressRequirements' => Values::array_get($payload, 'address_requirements'),
|
||||
'beta' => Values::array_get($payload, 'beta'),
|
||||
'capabilities' => Values::array_get($payload, 'capabilities'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.NationalInstance]';
|
||||
}
|
||||
}
|
||||
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php
vendored
Normal file
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class NationalList extends ListResource {
|
||||
/**
|
||||
* Construct the NationalList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/National.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams NationalInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads NationalInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return NationalInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of NationalInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 NationalPage Page of NationalInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): NationalPage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'AreaCode' => $options['areaCode'],
|
||||
'Contains' => $options['contains'],
|
||||
'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']),
|
||||
'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']),
|
||||
'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']),
|
||||
'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']),
|
||||
'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']),
|
||||
'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']),
|
||||
'Beta' => Serialize::booleanToString($options['beta']),
|
||||
'NearNumber' => $options['nearNumber'],
|
||||
'NearLatLong' => $options['nearLatLong'],
|
||||
'Distance' => $options['distance'],
|
||||
'InPostalCode' => $options['inPostalCode'],
|
||||
'InRegion' => $options['inRegion'],
|
||||
'InRateCenter' => $options['inRateCenter'],
|
||||
'InLata' => $options['inLata'],
|
||||
'InLocality' => $options['inLocality'],
|
||||
'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']),
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new NationalPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of NationalInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return NationalPage Page of NationalInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): NationalPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new NationalPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.NationalList]';
|
||||
}
|
||||
}
|
||||
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php
vendored
Normal file
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class NationalOptions {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return ReadNationalOptions Options builder
|
||||
*/
|
||||
public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadNationalOptions {
|
||||
return new ReadNationalOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
class ReadNationalOptions extends Options {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
*/
|
||||
public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
$this->options['contains'] = $contains;
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
$this->options['beta'] = $beta;
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
$this->options['distance'] = $distance;
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
$this->options['inLata'] = $inLata;
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAreaCode(int $areaCode): self {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
||||
*
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setContains(string $contains): self {
|
||||
$this->options['contains'] = $contains;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive text messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsEnabled(bool $smsEnabled): self {
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMmsEnabled(bool $mmsEnabled): self {
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive calls. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceEnabled(bool $voiceEnabled): self {
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self {
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self {
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self {
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.
|
||||
*
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setBeta(bool $beta): self {
|
||||
$this->options['beta'] = $beta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearNumber(string $nearNumber): self {
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearLatLong(string $nearLatLong): self {
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setDistance(int $distance): self {
|
||||
$this->options['distance'] = $distance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInPostalCode(string $inPostalCode): self {
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRegion(string $inRegion): self {
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRateCenter(string $inRateCenter): self {
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLata(string $inLata): self {
|
||||
$this->options['inLata'] = $inLata;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
|
||||
*
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLocality(string $inLocality): self {
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive faxes. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFaxEnabled(bool $faxEnabled): self {
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadNationalOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class NationalPage 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 NationalInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): NationalInstance {
|
||||
return new NationalInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.NationalPage]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $friendlyName
|
||||
* @property string $phoneNumber
|
||||
* @property string $lata
|
||||
* @property string $locality
|
||||
* @property string $rateCenter
|
||||
* @property string $latitude
|
||||
* @property string $longitude
|
||||
* @property string $region
|
||||
* @property string $postalCode
|
||||
* @property string $isoCountry
|
||||
* @property string $addressRequirements
|
||||
* @property bool $beta
|
||||
* @property string $capabilities
|
||||
*/
|
||||
class SharedCostInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the SharedCostInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'phoneNumber' => Values::array_get($payload, 'phone_number'),
|
||||
'lata' => Values::array_get($payload, 'lata'),
|
||||
'locality' => Values::array_get($payload, 'locality'),
|
||||
'rateCenter' => Values::array_get($payload, 'rate_center'),
|
||||
'latitude' => Values::array_get($payload, 'latitude'),
|
||||
'longitude' => Values::array_get($payload, 'longitude'),
|
||||
'region' => Values::array_get($payload, 'region'),
|
||||
'postalCode' => Values::array_get($payload, 'postal_code'),
|
||||
'isoCountry' => Values::array_get($payload, 'iso_country'),
|
||||
'addressRequirements' => Values::array_get($payload, 'address_requirements'),
|
||||
'beta' => Values::array_get($payload, 'beta'),
|
||||
'capabilities' => Values::array_get($payload, 'capabilities'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.SharedCostInstance]';
|
||||
}
|
||||
}
|
||||
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php
vendored
Normal file
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class SharedCostList extends ListResource {
|
||||
/**
|
||||
* Construct the SharedCostList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/SharedCost.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams SharedCostInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads SharedCostInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return SharedCostInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of SharedCostInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 SharedCostPage Page of SharedCostInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): SharedCostPage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'AreaCode' => $options['areaCode'],
|
||||
'Contains' => $options['contains'],
|
||||
'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']),
|
||||
'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']),
|
||||
'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']),
|
||||
'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']),
|
||||
'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']),
|
||||
'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']),
|
||||
'Beta' => Serialize::booleanToString($options['beta']),
|
||||
'NearNumber' => $options['nearNumber'],
|
||||
'NearLatLong' => $options['nearLatLong'],
|
||||
'Distance' => $options['distance'],
|
||||
'InPostalCode' => $options['inPostalCode'],
|
||||
'InRegion' => $options['inRegion'],
|
||||
'InRateCenter' => $options['inRateCenter'],
|
||||
'InLata' => $options['inLata'],
|
||||
'InLocality' => $options['inLocality'],
|
||||
'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']),
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new SharedCostPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of SharedCostInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return SharedCostPage Page of SharedCostInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): SharedCostPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new SharedCostPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.SharedCostList]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class SharedCostOptions {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return ReadSharedCostOptions Options builder
|
||||
*/
|
||||
public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadSharedCostOptions {
|
||||
return new ReadSharedCostOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
class ReadSharedCostOptions extends Options {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
*/
|
||||
public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
$this->options['contains'] = $contains;
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
$this->options['beta'] = $beta;
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
$this->options['distance'] = $distance;
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
$this->options['inLata'] = $inLata;
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAreaCode(int $areaCode): self {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
||||
*
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setContains(string $contains): self {
|
||||
$this->options['contains'] = $contains;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive text messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsEnabled(bool $smsEnabled): self {
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMmsEnabled(bool $mmsEnabled): self {
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive calls. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceEnabled(bool $voiceEnabled): self {
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self {
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self {
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self {
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.
|
||||
*
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setBeta(bool $beta): self {
|
||||
$this->options['beta'] = $beta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearNumber(string $nearNumber): self {
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearLatLong(string $nearLatLong): self {
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setDistance(int $distance): self {
|
||||
$this->options['distance'] = $distance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInPostalCode(string $inPostalCode): self {
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRegion(string $inRegion): self {
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRateCenter(string $inRateCenter): self {
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLata(string $inLata): self {
|
||||
$this->options['inLata'] = $inLata;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
|
||||
*
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLocality(string $inLocality): self {
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive faxes. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFaxEnabled(bool $faxEnabled): self {
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadSharedCostOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class SharedCostPage 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 SharedCostInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): SharedCostInstance {
|
||||
return new SharedCostInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.SharedCostPage]';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $friendlyName
|
||||
* @property string $phoneNumber
|
||||
* @property string $lata
|
||||
* @property string $locality
|
||||
* @property string $rateCenter
|
||||
* @property string $latitude
|
||||
* @property string $longitude
|
||||
* @property string $region
|
||||
* @property string $postalCode
|
||||
* @property string $isoCountry
|
||||
* @property string $addressRequirements
|
||||
* @property bool $beta
|
||||
* @property string $capabilities
|
||||
*/
|
||||
class TollFreeInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the TollFreeInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'phoneNumber' => Values::array_get($payload, 'phone_number'),
|
||||
'lata' => Values::array_get($payload, 'lata'),
|
||||
'locality' => Values::array_get($payload, 'locality'),
|
||||
'rateCenter' => Values::array_get($payload, 'rate_center'),
|
||||
'latitude' => Values::array_get($payload, 'latitude'),
|
||||
'longitude' => Values::array_get($payload, 'longitude'),
|
||||
'region' => Values::array_get($payload, 'region'),
|
||||
'postalCode' => Values::array_get($payload, 'postal_code'),
|
||||
'isoCountry' => Values::array_get($payload, 'iso_country'),
|
||||
'addressRequirements' => Values::array_get($payload, 'address_requirements'),
|
||||
'beta' => Values::array_get($payload, 'beta'),
|
||||
'capabilities' => Values::array_get($payload, 'capabilities'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.TollFreeInstance]';
|
||||
}
|
||||
}
|
||||
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php
vendored
Normal file
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class TollFreeList extends ListResource {
|
||||
/**
|
||||
* Construct the TollFreeList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/TollFree.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams TollFreeInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads TollFreeInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return TollFreeInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of TollFreeInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 TollFreePage Page of TollFreeInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): TollFreePage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'AreaCode' => $options['areaCode'],
|
||||
'Contains' => $options['contains'],
|
||||
'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']),
|
||||
'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']),
|
||||
'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']),
|
||||
'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']),
|
||||
'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']),
|
||||
'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']),
|
||||
'Beta' => Serialize::booleanToString($options['beta']),
|
||||
'NearNumber' => $options['nearNumber'],
|
||||
'NearLatLong' => $options['nearLatLong'],
|
||||
'Distance' => $options['distance'],
|
||||
'InPostalCode' => $options['inPostalCode'],
|
||||
'InRegion' => $options['inRegion'],
|
||||
'InRateCenter' => $options['inRateCenter'],
|
||||
'InLata' => $options['inLata'],
|
||||
'InLocality' => $options['inLocality'],
|
||||
'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']),
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new TollFreePage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of TollFreeInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return TollFreePage Page of TollFreeInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): TollFreePage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new TollFreePage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.TollFreeList]';
|
||||
}
|
||||
}
|
||||
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php
vendored
Normal file
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class TollFreeOptions {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return ReadTollFreeOptions Options builder
|
||||
*/
|
||||
public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadTollFreeOptions {
|
||||
return new ReadTollFreeOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
class ReadTollFreeOptions extends Options {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
*/
|
||||
public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
$this->options['contains'] = $contains;
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
$this->options['beta'] = $beta;
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
$this->options['distance'] = $distance;
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
$this->options['inLata'] = $inLata;
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAreaCode(int $areaCode): self {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
||||
*
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setContains(string $contains): self {
|
||||
$this->options['contains'] = $contains;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive text messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsEnabled(bool $smsEnabled): self {
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMmsEnabled(bool $mmsEnabled): self {
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive calls. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceEnabled(bool $voiceEnabled): self {
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self {
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self {
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self {
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.
|
||||
*
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setBeta(bool $beta): self {
|
||||
$this->options['beta'] = $beta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearNumber(string $nearNumber): self {
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearLatLong(string $nearLatLong): self {
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setDistance(int $distance): self {
|
||||
$this->options['distance'] = $distance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInPostalCode(string $inPostalCode): self {
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRegion(string $inRegion): self {
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRateCenter(string $inRateCenter): self {
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLata(string $inLata): self {
|
||||
$this->options['inLata'] = $inLata;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
|
||||
*
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLocality(string $inLocality): self {
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive faxes. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFaxEnabled(bool $faxEnabled): self {
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class TollFreePage 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 TollFreeInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): TollFreeInstance {
|
||||
return new TollFreeInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.TollFreePage]';
|
||||
}
|
||||
}
|
||||
92
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php
vendored
Normal file
92
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $friendlyName
|
||||
* @property string $phoneNumber
|
||||
* @property string $lata
|
||||
* @property string $locality
|
||||
* @property string $rateCenter
|
||||
* @property string $latitude
|
||||
* @property string $longitude
|
||||
* @property string $region
|
||||
* @property string $postalCode
|
||||
* @property string $isoCountry
|
||||
* @property string $addressRequirements
|
||||
* @property bool $beta
|
||||
* @property string $capabilities
|
||||
*/
|
||||
class VoipInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the VoipInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'friendlyName' => Values::array_get($payload, 'friendly_name'),
|
||||
'phoneNumber' => Values::array_get($payload, 'phone_number'),
|
||||
'lata' => Values::array_get($payload, 'lata'),
|
||||
'locality' => Values::array_get($payload, 'locality'),
|
||||
'rateCenter' => Values::array_get($payload, 'rate_center'),
|
||||
'latitude' => Values::array_get($payload, 'latitude'),
|
||||
'longitude' => Values::array_get($payload, 'longitude'),
|
||||
'region' => Values::array_get($payload, 'region'),
|
||||
'postalCode' => Values::array_get($payload, 'postal_code'),
|
||||
'isoCountry' => Values::array_get($payload, 'iso_country'),
|
||||
'addressRequirements' => Values::array_get($payload, 'address_requirements'),
|
||||
'beta' => Values::array_get($payload, 'beta'),
|
||||
'capabilities' => Values::array_get($payload, 'capabilities'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.VoipInstance]';
|
||||
}
|
||||
}
|
||||
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php
vendored
Normal file
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class VoipList extends ListResource {
|
||||
/**
|
||||
* Construct the VoipList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The account_sid
|
||||
* @param string $countryCode The ISO-3166-1 country code of the country.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Voip.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams VoipInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads VoipInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return VoipInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of VoipInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 VoipPage Page of VoipInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): VoipPage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'AreaCode' => $options['areaCode'],
|
||||
'Contains' => $options['contains'],
|
||||
'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']),
|
||||
'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']),
|
||||
'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']),
|
||||
'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']),
|
||||
'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']),
|
||||
'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']),
|
||||
'Beta' => Serialize::booleanToString($options['beta']),
|
||||
'NearNumber' => $options['nearNumber'],
|
||||
'NearLatLong' => $options['nearLatLong'],
|
||||
'Distance' => $options['distance'],
|
||||
'InPostalCode' => $options['inPostalCode'],
|
||||
'InRegion' => $options['inRegion'],
|
||||
'InRateCenter' => $options['inRateCenter'],
|
||||
'InLata' => $options['inLata'],
|
||||
'InLocality' => $options['inLocality'],
|
||||
'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']),
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new VoipPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of VoipInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return VoipPage Page of VoipInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): VoipPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new VoipPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.VoipList]';
|
||||
}
|
||||
}
|
||||
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php
vendored
Normal file
327
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php
vendored
Normal file
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class VoipOptions {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return ReadVoipOptions Options builder
|
||||
*/
|
||||
public static function read(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE): ReadVoipOptions {
|
||||
return new ReadVoipOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
class ReadVoipOptions extends Options {
|
||||
/**
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
*/
|
||||
public function __construct(int $areaCode = Values::NONE, string $contains = Values::NONE, bool $smsEnabled = Values::NONE, bool $mmsEnabled = Values::NONE, bool $voiceEnabled = Values::NONE, bool $excludeAllAddressRequired = Values::NONE, bool $excludeLocalAddressRequired = Values::NONE, bool $excludeForeignAddressRequired = Values::NONE, bool $beta = Values::NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::NONE) {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
$this->options['contains'] = $contains;
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
$this->options['beta'] = $beta;
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
$this->options['distance'] = $distance;
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
$this->options['inLata'] = $inLata;
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $areaCode The area code of the phone numbers to read
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setAreaCode(int $areaCode): self {
|
||||
$this->options['areaCode'] = $areaCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters.
|
||||
*
|
||||
* @param string $contains The pattern on which to match phone numbers
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setContains(string $contains): self {
|
||||
$this->options['contains'] = $contains;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive text messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $smsEnabled Whether the phone numbers can receive text messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSmsEnabled(bool $smsEnabled): self {
|
||||
$this->options['smsEnabled'] = $smsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive MMS messages. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $mmsEnabled Whether the phone numbers can receive MMS messages
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMmsEnabled(bool $mmsEnabled): self {
|
||||
$this->options['mmsEnabled'] = $mmsEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive calls. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $voiceEnabled Whether the phone numbers can receive calls.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setVoiceEnabled(bool $voiceEnabled): self {
|
||||
$this->options['voiceEnabled'] = $voiceEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeAllAddressRequired Whether to exclude phone numbers that
|
||||
* require an Address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self {
|
||||
$this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeLocalAddressRequired Whether to exclude phone numbers
|
||||
* that require a local address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self {
|
||||
$this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`.
|
||||
*
|
||||
* @param bool $excludeForeignAddressRequired Whether to exclude phone numbers
|
||||
* that require a foreign address
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self {
|
||||
$this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`.
|
||||
*
|
||||
* @param bool $beta Whether to read phone numbers new to the Twilio platform
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setBeta(bool $beta): self {
|
||||
$this->options['beta'] = $beta;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearNumber Given a phone number, find a geographically close
|
||||
* number within distance miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearNumber(string $nearNumber): self {
|
||||
$this->options['nearNumber'] = $nearNumber;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $nearLatLong Given a latitude/longitude pair lat,long find
|
||||
* geographically close numbers within distance
|
||||
* miles. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setNearLatLong(string $nearLatLong): self {
|
||||
$this->options['nearLatLong'] = $nearLatLong;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param int $distance The search radius, in miles, for a near_ query.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setDistance(int $distance): self {
|
||||
$this->options['distance'] = $distance;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inPostalCode Limit results to a particular postal code.
|
||||
* (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInPostalCode(string $inPostalCode): self {
|
||||
$this->options['inPostalCode'] = $inPostalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRegion Limit results to a particular region. (US/Canada
|
||||
* only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRegion(string $inRegion): self {
|
||||
$this->options['inRegion'] = $inRegion;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inRateCenter Limit results to a specific rate center, or
|
||||
* given a phone number search within the same rate
|
||||
* center as that number. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInRateCenter(string $inRateCenter): self {
|
||||
$this->options['inRateCenter'] = $inRateCenter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada.
|
||||
*
|
||||
* @param string $inLata Limit results to a specific local access and transport
|
||||
* area. (US/Canada only)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLata(string $inLata): self {
|
||||
$this->options['inLata'] = $inLata;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number.
|
||||
*
|
||||
* @param string $inLocality Limit results to a particular locality
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInLocality(string $inLocality): self {
|
||||
$this->options['inLocality'] = $inLocality;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the phone numbers can receive faxes. Can be: `true` or `false`.
|
||||
*
|
||||
* @param bool $faxEnabled Whether the phone numbers can receive faxes
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setFaxEnabled(bool $faxEnabled): self {
|
||||
$this->options['faxEnabled'] = $faxEnabled;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadVoipOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class VoipPage 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 VoipInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): VoipInstance {
|
||||
return new VoipInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.VoipPage]';
|
||||
}
|
||||
}
|
||||
229
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
vendored
Normal file
229
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php
vendored
Normal file
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property LocalList $local
|
||||
* @property TollFreeList $tollFree
|
||||
* @property MobileList $mobile
|
||||
* @property NationalList $national
|
||||
* @property VoipList $voip
|
||||
* @property SharedCostList $sharedCost
|
||||
* @property MachineToMachineList $machineToMachine
|
||||
*/
|
||||
class AvailablePhoneNumberCountryContext extends InstanceContext {
|
||||
protected $_local;
|
||||
protected $_tollFree;
|
||||
protected $_mobile;
|
||||
protected $_national;
|
||||
protected $_voip;
|
||||
protected $_sharedCost;
|
||||
protected $_machineToMachine;
|
||||
|
||||
/**
|
||||
* Initialize the AvailablePhoneNumberCountryContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account requesting the available
|
||||
* phone number Country resource
|
||||
* @param string $countryCode The ISO country code of the country to fetch
|
||||
* available phone number information about
|
||||
*/
|
||||
public function __construct(Version $version, $accountSid, $countryCode) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the AvailablePhoneNumberCountryInstance
|
||||
*
|
||||
* @return AvailablePhoneNumberCountryInstance Fetched
|
||||
* AvailablePhoneNumberCountryInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): AvailablePhoneNumberCountryInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new AvailablePhoneNumberCountryInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the local
|
||||
*/
|
||||
protected function getLocal(): LocalList {
|
||||
if (!$this->_local) {
|
||||
$this->_local = new LocalList(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_local;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the tollFree
|
||||
*/
|
||||
protected function getTollFree(): TollFreeList {
|
||||
if (!$this->_tollFree) {
|
||||
$this->_tollFree = new TollFreeList(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_tollFree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the mobile
|
||||
*/
|
||||
protected function getMobile(): MobileList {
|
||||
if (!$this->_mobile) {
|
||||
$this->_mobile = new MobileList(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_mobile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the national
|
||||
*/
|
||||
protected function getNational(): NationalList {
|
||||
if (!$this->_national) {
|
||||
$this->_national = new NationalList(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_national;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the voip
|
||||
*/
|
||||
protected function getVoip(): VoipList {
|
||||
if (!$this->_voip) {
|
||||
$this->_voip = new VoipList(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_voip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the sharedCost
|
||||
*/
|
||||
protected function getSharedCost(): SharedCostList {
|
||||
if (!$this->_sharedCost) {
|
||||
$this->_sharedCost = new SharedCostList(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_sharedCost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the machineToMachine
|
||||
*/
|
||||
protected function getMachineToMachine(): MachineToMachineList {
|
||||
if (!$this->_machineToMachine) {
|
||||
$this->_machineToMachine = new MachineToMachineList(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->_machineToMachine;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.AvailablePhoneNumberCountryContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
179
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php
vendored
Normal file
179
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList;
|
||||
use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $countryCode
|
||||
* @property string $country
|
||||
* @property string $uri
|
||||
* @property bool $beta
|
||||
* @property array $subresourceUris
|
||||
*/
|
||||
class AvailablePhoneNumberCountryInstance extends InstanceResource {
|
||||
protected $_local;
|
||||
protected $_tollFree;
|
||||
protected $_mobile;
|
||||
protected $_national;
|
||||
protected $_voip;
|
||||
protected $_sharedCost;
|
||||
protected $_machineToMachine;
|
||||
|
||||
/**
|
||||
* Initialize the AvailablePhoneNumberCountryInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid A 34 character string that uniquely identifies
|
||||
* this resource.
|
||||
* @param string $countryCode The ISO country code of the country to fetch
|
||||
* available phone number information about
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $countryCode = null) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'countryCode' => Values::array_get($payload, 'country_code'),
|
||||
'country' => Values::array_get($payload, 'country'),
|
||||
'uri' => Values::array_get($payload, 'uri'),
|
||||
'beta' => Values::array_get($payload, 'beta'),
|
||||
'subresourceUris' => Values::array_get($payload, 'subresource_uris'),
|
||||
];
|
||||
|
||||
$this->solution = [
|
||||
'accountSid' => $accountSid,
|
||||
'countryCode' => $countryCode ?: $this->properties['countryCode'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return AvailablePhoneNumberCountryContext Context for this
|
||||
* AvailablePhoneNumberCountryInstance
|
||||
*/
|
||||
protected function proxy(): AvailablePhoneNumberCountryContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new AvailablePhoneNumberCountryContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['countryCode']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the AvailablePhoneNumberCountryInstance
|
||||
*
|
||||
* @return AvailablePhoneNumberCountryInstance Fetched
|
||||
* AvailablePhoneNumberCountryInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): AvailablePhoneNumberCountryInstance {
|
||||
return $this->proxy()->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the local
|
||||
*/
|
||||
protected function getLocal(): LocalList {
|
||||
return $this->proxy()->local;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the tollFree
|
||||
*/
|
||||
protected function getTollFree(): TollFreeList {
|
||||
return $this->proxy()->tollFree;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the mobile
|
||||
*/
|
||||
protected function getMobile(): MobileList {
|
||||
return $this->proxy()->mobile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the national
|
||||
*/
|
||||
protected function getNational(): NationalList {
|
||||
return $this->proxy()->national;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the voip
|
||||
*/
|
||||
protected function getVoip(): VoipList {
|
||||
return $this->proxy()->voip;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the sharedCost
|
||||
*/
|
||||
protected function getSharedCost(): SharedCostList {
|
||||
return $this->proxy()->sharedCost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access the machineToMachine
|
||||
*/
|
||||
protected function getMachineToMachine(): MachineToMachineList {
|
||||
return $this->proxy()->machineToMachine;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.AvailablePhoneNumberCountryInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
139
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php
vendored
Normal file
139
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class AvailablePhoneNumberCountryList extends ListResource {
|
||||
/**
|
||||
* Construct the AvailablePhoneNumberCountryList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid A 34 character string that uniquely identifies
|
||||
* this resource.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams AvailablePhoneNumberCountryInstance 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 AvailablePhoneNumberCountryInstance 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 AvailablePhoneNumberCountryInstance[] 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 AvailablePhoneNumberCountryInstance 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 AvailablePhoneNumberCountryPage Page of
|
||||
* AvailablePhoneNumberCountryInstance
|
||||
*/
|
||||
public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): AvailablePhoneNumberCountryPage {
|
||||
$params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of AvailablePhoneNumberCountryInstance records from
|
||||
* the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return AvailablePhoneNumberCountryPage Page of
|
||||
* AvailablePhoneNumberCountryInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): AvailablePhoneNumberCountryPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a AvailablePhoneNumberCountryContext
|
||||
*
|
||||
* @param string $countryCode The ISO country code of the country to fetch
|
||||
* available phone number information about
|
||||
*/
|
||||
public function getContext(string $countryCode): AvailablePhoneNumberCountryContext {
|
||||
return new AvailablePhoneNumberCountryContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$countryCode
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.AvailablePhoneNumberCountryList]';
|
||||
}
|
||||
}
|
||||
49
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php
vendored
Normal file
49
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class AvailablePhoneNumberCountryPage 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 AvailablePhoneNumberCountryInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): AvailablePhoneNumberCountryInstance {
|
||||
return new AvailablePhoneNumberCountryInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.AvailablePhoneNumberCountryPage]';
|
||||
}
|
||||
}
|
||||
71
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceInstance.php
vendored
Normal file
71
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceInstance.php
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property string $balance
|
||||
* @property string $currency
|
||||
*/
|
||||
class BalanceInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the BalanceInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid Account Sid.
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'balance' => Values::array_get($payload, 'balance'),
|
||||
'currency' => Values::array_get($payload, 'currency'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.BalanceInstance]';
|
||||
}
|
||||
}
|
||||
53
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceList.php
vendored
Normal file
53
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalanceList.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class BalanceList extends ListResource {
|
||||
/**
|
||||
* Construct the BalanceList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid Account Sid.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Balance.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the BalanceInstance
|
||||
*
|
||||
* @return BalanceInstance Fetched BalanceInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): BalanceInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new BalanceInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.BalanceList]';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalancePage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/BalancePage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class BalancePage 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 BalanceInstance \Twilio\Rest\Api\V2010\Account\BalanceInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): BalanceInstance {
|
||||
return new BalanceInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.BalancePage]';
|
||||
}
|
||||
}
|
||||
70
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php
vendored
Normal file
70
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property array $request
|
||||
* @property array $response
|
||||
*/
|
||||
class EventInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the EventInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The SID of the Account that created this resource
|
||||
* @param string $callSid The unique string that identifies this resource
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $callSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'request' => Values::array_get($payload, 'request'),
|
||||
'response' => Values::array_get($payload, 'response'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.EventInstance]';
|
||||
}
|
||||
}
|
||||
120
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventList.php
vendored
Normal file
120
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventList.php
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class EventList extends ListResource {
|
||||
/**
|
||||
* Construct the EventList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created this resource
|
||||
* @param string $callSid The unique string that identifies this resource
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $callSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Events.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams EventInstance 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 EventInstance 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 EventInstance[] 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 EventInstance 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 EventPage Page of EventInstance
|
||||
*/
|
||||
public function page($pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): EventPage {
|
||||
$params = Values::of(['PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new EventPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of EventInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return EventPage Page of EventInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): EventPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new EventPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.EventList]';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventPage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventPage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class EventPage 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 EventInstance \Twilio\Rest\Api\V2010\Account\Call\EventInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): EventInstance {
|
||||
return new EventInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.EventPage]';
|
||||
}
|
||||
}
|
||||
116
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackContext.php
vendored
Normal file
116
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackContext.php
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class FeedbackContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the FeedbackContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The unique sid that identifies this account
|
||||
* @param string $callSid The call sid that uniquely identifies the call
|
||||
*/
|
||||
public function __construct(Version $version, $accountSid, $callSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Feedback.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the FeedbackInstance
|
||||
*
|
||||
* @return FeedbackInstance Fetched FeedbackInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): FeedbackInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new FeedbackInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the FeedbackInstance
|
||||
*
|
||||
* @param int $qualityScore The call quality expressed as an integer from 1 to 5
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return FeedbackInstance Created FeedbackInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(int $qualityScore, array $options = []): FeedbackInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'QualityScore' => $qualityScore,
|
||||
'Issue' => Serialize::map($options['issue'], function($e) { return $e; }),
|
||||
]);
|
||||
|
||||
$payload = $this->version->create('POST', $this->uri, [], $data);
|
||||
|
||||
return new FeedbackInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the FeedbackInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return FeedbackInstance Updated FeedbackInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): FeedbackInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'QualityScore' => $options['qualityScore'],
|
||||
'Issue' => Serialize::map($options['issue'], function($e) { return $e; }),
|
||||
]);
|
||||
|
||||
$payload = $this->version->update('POST', $this->uri, [], $data);
|
||||
|
||||
return new FeedbackInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.FeedbackContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
135
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackInstance.php
vendored
Normal file
135
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackInstance.php
vendored
Normal file
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string[] $issues
|
||||
* @property int $qualityScore
|
||||
* @property string $sid
|
||||
*/
|
||||
class FeedbackInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the FeedbackInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The unique sid that identifies this account
|
||||
* @param string $callSid The unique string that identifies this resource
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $callSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'issues' => Values::array_get($payload, 'issues'),
|
||||
'qualityScore' => Values::array_get($payload, 'quality_score'),
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return FeedbackContext Context for this FeedbackInstance
|
||||
*/
|
||||
protected function proxy(): FeedbackContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new FeedbackContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the FeedbackInstance
|
||||
*
|
||||
* @return FeedbackInstance Fetched FeedbackInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): FeedbackInstance {
|
||||
return $this->proxy()->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the FeedbackInstance
|
||||
*
|
||||
* @param int $qualityScore The call quality expressed as an integer from 1 to 5
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return FeedbackInstance Created FeedbackInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(int $qualityScore, array $options = []): FeedbackInstance {
|
||||
return $this->proxy()->create($qualityScore, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the FeedbackInstance
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return FeedbackInstance Updated FeedbackInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(array $options = []): FeedbackInstance {
|
||||
return $this->proxy()->update($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(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.Api.V2010.FeedbackInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
49
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackList.php
vendored
Normal file
49
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackList.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Version;
|
||||
|
||||
class FeedbackList extends ListResource {
|
||||
/**
|
||||
* Construct the FeedbackList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The unique sid that identifies this account
|
||||
* @param string $callSid The unique string that identifies this resource
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $callSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a FeedbackContext
|
||||
*/
|
||||
public function getContext(): FeedbackContext {
|
||||
return new FeedbackContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.FeedbackList]';
|
||||
}
|
||||
}
|
||||
105
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.php
vendored
Normal file
105
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.php
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class FeedbackOptions {
|
||||
/**
|
||||
* @param string[] $issue Issues experienced during the call
|
||||
* @return CreateFeedbackOptions Options builder
|
||||
*/
|
||||
public static function create(array $issue = Values::ARRAY_NONE): CreateFeedbackOptions {
|
||||
return new CreateFeedbackOptions($issue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $qualityScore The call quality expressed as an integer from 1 to 5
|
||||
* @param string[] $issue Issues experienced during the call
|
||||
* @return UpdateFeedbackOptions Options builder
|
||||
*/
|
||||
public static function update(int $qualityScore = Values::NONE, array $issue = Values::ARRAY_NONE): UpdateFeedbackOptions {
|
||||
return new UpdateFeedbackOptions($qualityScore, $issue);
|
||||
}
|
||||
}
|
||||
|
||||
class CreateFeedbackOptions extends Options {
|
||||
/**
|
||||
* @param string[] $issue Issues experienced during the call
|
||||
*/
|
||||
public function __construct(array $issue = Values::ARRAY_NONE) {
|
||||
$this->options['issue'] = $issue;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of one or more issues experienced during the call. Issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`.
|
||||
*
|
||||
* @param string[] $issue Issues experienced during the call
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setIssue(array $issue): self {
|
||||
$this->options['issue'] = $issue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.CreateFeedbackOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateFeedbackOptions extends Options {
|
||||
/**
|
||||
* @param int $qualityScore The call quality expressed as an integer from 1 to 5
|
||||
* @param string[] $issue Issues experienced during the call
|
||||
*/
|
||||
public function __construct(int $qualityScore = Values::NONE, array $issue = Values::ARRAY_NONE) {
|
||||
$this->options['qualityScore'] = $qualityScore;
|
||||
$this->options['issue'] = $issue;
|
||||
}
|
||||
|
||||
/**
|
||||
* The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call.
|
||||
*
|
||||
* @param int $qualityScore The call quality expressed as an integer from 1 to 5
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setQualityScore(int $qualityScore): self {
|
||||
$this->options['qualityScore'] = $qualityScore;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`.
|
||||
*
|
||||
* @param string[] $issue Issues experienced during the call
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setIssue(array $issue): self {
|
||||
$this->options['issue'] = $issue;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.UpdateFeedbackOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackPage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackPage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class FeedbackPage 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 FeedbackInstance \Twilio\Rest\Api\V2010\Account\Call\FeedbackInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): FeedbackInstance {
|
||||
return new FeedbackInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.FeedbackPage]';
|
||||
}
|
||||
}
|
||||
74
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryContext.php
vendored
Normal file
74
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryContext.php
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class FeedbackSummaryContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the FeedbackSummaryContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The unique sid that identifies this account
|
||||
* @param string $sid A string that uniquely identifies this feedback summary
|
||||
* resource
|
||||
*/
|
||||
public function __construct(Version $version, $accountSid, $sid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'sid' => $sid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/FeedbackSummary/' . \rawurlencode($sid) . '.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the FeedbackSummaryInstance
|
||||
*
|
||||
* @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): FeedbackSummaryInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new FeedbackSummaryInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the FeedbackSummaryInstance
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.Api.V2010.FeedbackSummaryContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
138
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryInstance.php
vendored
Normal file
138
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryInstance.php
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property int $callCount
|
||||
* @property int $callFeedbackCount
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property \DateTime $endDate
|
||||
* @property bool $includeSubaccounts
|
||||
* @property array[] $issues
|
||||
* @property string $qualityScoreAverage
|
||||
* @property string $qualityScoreMedian
|
||||
* @property string $qualityScoreStandardDeviation
|
||||
* @property string $sid
|
||||
* @property \DateTime $startDate
|
||||
* @property string $status
|
||||
*/
|
||||
class FeedbackSummaryInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the FeedbackSummaryInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The SID of the Account that created this resource
|
||||
* @param string $sid A string that uniquely identifies this feedback summary
|
||||
* resource
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'callCount' => Values::array_get($payload, 'call_count'),
|
||||
'callFeedbackCount' => Values::array_get($payload, 'call_feedback_count'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')),
|
||||
'includeSubaccounts' => Values::array_get($payload, 'include_subaccounts'),
|
||||
'issues' => Values::array_get($payload, 'issues'),
|
||||
'qualityScoreAverage' => Values::array_get($payload, 'quality_score_average'),
|
||||
'qualityScoreMedian' => Values::array_get($payload, 'quality_score_median'),
|
||||
'qualityScoreStandardDeviation' => Values::array_get($payload, 'quality_score_standard_deviation'),
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')),
|
||||
'status' => Values::array_get($payload, 'status'),
|
||||
];
|
||||
|
||||
$this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an instance context for the instance, the context is capable of
|
||||
* performing various actions. All instance actions are proxied to the context
|
||||
*
|
||||
* @return FeedbackSummaryContext Context for this FeedbackSummaryInstance
|
||||
*/
|
||||
protected function proxy(): FeedbackSummaryContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new FeedbackSummaryContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the FeedbackSummaryInstance
|
||||
*
|
||||
* @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): FeedbackSummaryInstance {
|
||||
return $this->proxy()->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete the FeedbackSummaryInstance
|
||||
*
|
||||
* @return bool True if delete succeeds, false otherwise
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function delete(): bool {
|
||||
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(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.Api.V2010.FeedbackSummaryInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
78
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryList.php
vendored
Normal file
78
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryList.php
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class FeedbackSummaryList extends ListResource {
|
||||
/**
|
||||
* Construct the FeedbackSummaryList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created this resource
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/FeedbackSummary.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the FeedbackSummaryInstance
|
||||
*
|
||||
* @param \DateTime $startDate Only include feedback given on or after this date
|
||||
* @param \DateTime $endDate Only include feedback given on or before this date
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return FeedbackSummaryInstance Created FeedbackSummaryInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(\DateTime $startDate, \DateTime $endDate, array $options = []): FeedbackSummaryInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'StartDate' => Serialize::iso8601Date($startDate),
|
||||
'EndDate' => Serialize::iso8601Date($endDate),
|
||||
'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']),
|
||||
'StatusCallback' => $options['statusCallback'],
|
||||
'StatusCallbackMethod' => $options['statusCallbackMethod'],
|
||||
]);
|
||||
|
||||
$payload = $this->version->create('POST', $this->uri, [], $data);
|
||||
|
||||
return new FeedbackSummaryInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a FeedbackSummaryContext
|
||||
*
|
||||
* @param string $sid A string that uniquely identifies this feedback summary
|
||||
* resource
|
||||
*/
|
||||
public function getContext(string $sid): FeedbackSummaryContext {
|
||||
return new FeedbackSummaryContext($this->version, $this->solution['accountSid'], $sid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.FeedbackSummaryList]';
|
||||
}
|
||||
}
|
||||
90
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.php
vendored
Normal file
90
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.php
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class FeedbackSummaryOptions {
|
||||
/**
|
||||
* @param bool $includeSubaccounts `true` includes feedback from the specified
|
||||
* account and its subaccounts
|
||||
* @param string $statusCallback The URL that we will request when the feedback
|
||||
* summary is complete
|
||||
* @param string $statusCallbackMethod The HTTP method we use to make requests
|
||||
* to the StatusCallback URL
|
||||
* @return CreateFeedbackSummaryOptions Options builder
|
||||
*/
|
||||
public static function create(bool $includeSubaccounts = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE): CreateFeedbackSummaryOptions {
|
||||
return new CreateFeedbackSummaryOptions($includeSubaccounts, $statusCallback, $statusCallbackMethod);
|
||||
}
|
||||
}
|
||||
|
||||
class CreateFeedbackSummaryOptions extends Options {
|
||||
/**
|
||||
* @param bool $includeSubaccounts `true` includes feedback from the specified
|
||||
* account and its subaccounts
|
||||
* @param string $statusCallback The URL that we will request when the feedback
|
||||
* summary is complete
|
||||
* @param string $statusCallbackMethod The HTTP method we use to make requests
|
||||
* to the StatusCallback URL
|
||||
*/
|
||||
public function __construct(bool $includeSubaccounts = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE) {
|
||||
$this->options['includeSubaccounts'] = $includeSubaccounts;
|
||||
$this->options['statusCallback'] = $statusCallback;
|
||||
$this->options['statusCallbackMethod'] = $statusCallbackMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account.
|
||||
*
|
||||
* @param bool $includeSubaccounts `true` includes feedback from the specified
|
||||
* account and its subaccounts
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setIncludeSubaccounts(bool $includeSubaccounts): self {
|
||||
$this->options['includeSubaccounts'] = $includeSubaccounts;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The URL that we will request when the feedback summary is complete.
|
||||
*
|
||||
* @param string $statusCallback The URL that we will request when the feedback
|
||||
* summary is complete
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStatusCallback(string $statusCallback): self {
|
||||
$this->options['statusCallback'] = $statusCallback;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL.
|
||||
*
|
||||
* @param string $statusCallbackMethod The HTTP method we use to make requests
|
||||
* to the StatusCallback URL
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStatusCallbackMethod(string $statusCallbackMethod): self {
|
||||
$this->options['statusCallbackMethod'] = $statusCallbackMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.CreateFeedbackSummaryOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryPage.php
vendored
Normal file
45
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryPage.php
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class FeedbackSummaryPage 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 FeedbackSummaryInstance \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): FeedbackSummaryInstance {
|
||||
return new FeedbackSummaryInstance($this->version, $payload, $this->solution['accountSid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.FeedbackSummaryPage]';
|
||||
}
|
||||
}
|
||||
66
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php
vendored
Normal file
66
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class NotificationContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the NotificationContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* to fetch
|
||||
* @param string $callSid The Call SID of the resource to fetch
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function __construct(Version $version, $accountSid, $callSid, $sid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Notifications/' . \rawurlencode($sid) . '.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the NotificationInstance
|
||||
*
|
||||
* @return NotificationInstance Fetched NotificationInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): NotificationInstance {
|
||||
$payload = $this->version->fetch('GET', $this->uri);
|
||||
|
||||
return new NotificationInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid'],
|
||||
$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.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
139
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php
vendored
Normal file
139
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
/**
|
||||
* @property string $accountSid
|
||||
* @property string $apiVersion
|
||||
* @property string $callSid
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $errorCode
|
||||
* @property string $log
|
||||
* @property \DateTime $messageDate
|
||||
* @property string $messageText
|
||||
* @property string $moreInfo
|
||||
* @property string $requestMethod
|
||||
* @property string $requestUrl
|
||||
* @property string $requestVariables
|
||||
* @property string $responseBody
|
||||
* @property string $responseHeaders
|
||||
* @property string $sid
|
||||
* @property string $uri
|
||||
*/
|
||||
class NotificationInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the NotificationInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* @param string $callSid The SID of the Call the resource is associated with
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'apiVersion' => Values::array_get($payload, 'api_version'),
|
||||
'callSid' => Values::array_get($payload, 'call_sid'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'errorCode' => Values::array_get($payload, 'error_code'),
|
||||
'log' => Values::array_get($payload, 'log'),
|
||||
'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')),
|
||||
'messageText' => Values::array_get($payload, 'message_text'),
|
||||
'moreInfo' => Values::array_get($payload, 'more_info'),
|
||||
'requestMethod' => Values::array_get($payload, 'request_method'),
|
||||
'requestUrl' => Values::array_get($payload, 'request_url'),
|
||||
'requestVariables' => Values::array_get($payload, 'request_variables'),
|
||||
'responseBody' => Values::array_get($payload, 'response_body'),
|
||||
'responseHeaders' => Values::array_get($payload, 'response_headers'),
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
'uri' => Values::array_get($payload, 'uri'),
|
||||
];
|
||||
|
||||
$this->solution = [
|
||||
'accountSid' => $accountSid,
|
||||
'callSid' => $callSid,
|
||||
'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 NotificationContext Context for this NotificationInstance
|
||||
*/
|
||||
protected function proxy(): NotificationContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new NotificationContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the NotificationInstance
|
||||
*
|
||||
* @return NotificationInstance Fetched NotificationInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function fetch(): NotificationInstance {
|
||||
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.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php
vendored
Normal file
149
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
use Twilio\Stream;
|
||||
use Twilio\Values;
|
||||
use Twilio\Version;
|
||||
|
||||
class NotificationList extends ListResource {
|
||||
/**
|
||||
* Construct the NotificationList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created the resource
|
||||
* @param string $callSid The SID of the Call the resource is associated with
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $callSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Notifications.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Streams NotificationInstance records from the API as a generator stream.
|
||||
* This operation lazily loads records as efficiently as possible until the
|
||||
* limit
|
||||
* is reached.
|
||||
* The results are returned as a generator, so this operation is memory
|
||||
* efficient.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. stream()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, stream()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return Stream stream of results
|
||||
*/
|
||||
public function stream(array $options = [], int $limit = null, $pageSize = null): Stream {
|
||||
$limits = $this->version->readLimits($limit, $pageSize);
|
||||
|
||||
$page = $this->page($options, $limits['pageSize']);
|
||||
|
||||
return $this->version->stream($page, $limits['limit'], $limits['pageLimit']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads NotificationInstance records from the API as a list.
|
||||
* Unlike stream(), this operation is eager and will load `limit` records into
|
||||
* memory before returning.
|
||||
*
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @param int $limit Upper limit for the number of records to return. read()
|
||||
* guarantees to never return more than limit. Default is no
|
||||
* limit
|
||||
* @param mixed $pageSize Number of records to fetch per request, when not set
|
||||
* will use the default value of 50 records. If no
|
||||
* page_size is defined but a limit is defined, read()
|
||||
* will attempt to read the limit with the most
|
||||
* efficient page size, i.e. min(limit, 1000)
|
||||
* @return NotificationInstance[] Array of results
|
||||
*/
|
||||
public function read(array $options = [], int $limit = null, $pageSize = null): array {
|
||||
return \iterator_to_array($this->stream($options, $limit, $pageSize), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a single page of NotificationInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param array|Options $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 NotificationPage Page of NotificationInstance
|
||||
*/
|
||||
public function page(array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE): NotificationPage {
|
||||
$options = new Values($options);
|
||||
|
||||
$params = Values::of([
|
||||
'Log' => $options['log'],
|
||||
'MessageDate<' => Serialize::iso8601Date($options['messageDateBefore']),
|
||||
'MessageDate' => Serialize::iso8601Date($options['messageDate']),
|
||||
'MessageDate>' => Serialize::iso8601Date($options['messageDateAfter']),
|
||||
'PageToken' => $pageToken,
|
||||
'Page' => $pageNumber,
|
||||
'PageSize' => $pageSize,
|
||||
]);
|
||||
|
||||
$response = $this->version->page('GET', $this->uri, $params);
|
||||
|
||||
return new NotificationPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a specific page of NotificationInstance records from the API.
|
||||
* Request is executed immediately
|
||||
*
|
||||
* @param string $targetUrl API-generated URL for the requested results page
|
||||
* @return NotificationPage Page of NotificationInstance
|
||||
*/
|
||||
public function getPage(string $targetUrl): NotificationPage {
|
||||
$response = $this->version->getDomain()->getClient()->request(
|
||||
'GET',
|
||||
$targetUrl
|
||||
);
|
||||
|
||||
return new NotificationPage($this->version, $response, $this->solution);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a NotificationContext
|
||||
*
|
||||
* @param string $sid The unique string that identifies the resource
|
||||
*/
|
||||
public function getContext(string $sid): NotificationContext {
|
||||
return new NotificationContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid'],
|
||||
$sid
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.NotificationList]';
|
||||
}
|
||||
}
|
||||
95
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php
vendored
Normal file
95
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
abstract class NotificationOptions {
|
||||
/**
|
||||
* @param int $log Filter by log level
|
||||
* @param string $messageDateBefore Filter by date
|
||||
* @param string $messageDate Filter by date
|
||||
* @param string $messageDateAfter Filter by date
|
||||
* @return ReadNotificationOptions Options builder
|
||||
*/
|
||||
public static function read(int $log = Values::NONE, string $messageDateBefore = Values::NONE, string $messageDate = Values::NONE, string $messageDateAfter = Values::NONE): ReadNotificationOptions {
|
||||
return new ReadNotificationOptions($log, $messageDateBefore, $messageDate, $messageDateAfter);
|
||||
}
|
||||
}
|
||||
|
||||
class ReadNotificationOptions extends Options {
|
||||
/**
|
||||
* @param int $log Filter by log level
|
||||
* @param string $messageDateBefore Filter by date
|
||||
* @param string $messageDate Filter by date
|
||||
* @param string $messageDateAfter Filter by date
|
||||
*/
|
||||
public function __construct(int $log = Values::NONE, string $messageDateBefore = Values::NONE, string $messageDate = Values::NONE, string $messageDateAfter = Values::NONE) {
|
||||
$this->options['log'] = $log;
|
||||
$this->options['messageDateBefore'] = $messageDateBefore;
|
||||
$this->options['messageDate'] = $messageDate;
|
||||
$this->options['messageDateAfter'] = $messageDateAfter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read.
|
||||
*
|
||||
* @param int $log Filter by log level
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setLog(int $log): self {
|
||||
$this->options['log'] = $log;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
|
||||
*
|
||||
* @param string $messageDateBefore Filter by date
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMessageDateBefore(string $messageDateBefore): self {
|
||||
$this->options['messageDateBefore'] = $messageDateBefore;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
|
||||
*
|
||||
* @param string $messageDate Filter by date
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMessageDate(string $messageDate): self {
|
||||
$this->options['messageDate'] = $messageDate;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date.
|
||||
*
|
||||
* @param string $messageDateAfter Filter by date
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMessageDateAfter(string $messageDateAfter): self {
|
||||
$this->options['messageDateAfter'] = $messageDateAfter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php
vendored
Normal file
50
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Http\Response;
|
||||
use Twilio\Page;
|
||||
use Twilio\Version;
|
||||
|
||||
class NotificationPage 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 NotificationInstance \Twilio\Rest\Api\V2010\Account\Call\NotificationInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): NotificationInstance {
|
||||
return new NotificationInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.NotificationPage]';
|
||||
}
|
||||
}
|
||||
86
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php
vendored
Normal file
86
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceContext;
|
||||
use Twilio\Options;
|
||||
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 PaymentContext extends InstanceContext {
|
||||
/**
|
||||
* Initialize the PaymentContext
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that will update the
|
||||
* resource
|
||||
* @param string $callSid The SID of the call that will create the resource.
|
||||
* @param string $sid The SID of Payments session
|
||||
*/
|
||||
public function __construct(Version $version, $accountSid, $callSid, $sid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Payments/' . \rawurlencode($sid) . '.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the PaymentInstance
|
||||
*
|
||||
* @param string $idempotencyKey A unique token that will be used to ensure
|
||||
* that multiple API calls with the same
|
||||
* information do not result in multiple
|
||||
* transactions.
|
||||
* @param string $statusCallback Provide an absolute or relative URL to receive
|
||||
* status updates regarding your Pay session.
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return PaymentInstance Updated PaymentInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'IdempotencyKey' => $idempotencyKey,
|
||||
'StatusCallback' => $statusCallback,
|
||||
'Capture' => $options['capture'],
|
||||
'Status' => $options['status'],
|
||||
]);
|
||||
|
||||
$payload = $this->version->update('POST', $this->uri, [], $data);
|
||||
|
||||
return new PaymentInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid'],
|
||||
$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.Api.V2010.PaymentContext ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
128
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php
vendored
Normal file
128
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Deserialize;
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\InstanceResource;
|
||||
use Twilio\Options;
|
||||
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 $accountSid
|
||||
* @property string $callSid
|
||||
* @property string $sid
|
||||
* @property \DateTime $dateCreated
|
||||
* @property \DateTime $dateUpdated
|
||||
* @property string $uri
|
||||
*/
|
||||
class PaymentInstance extends InstanceResource {
|
||||
/**
|
||||
* Initialize the PaymentInstance
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param mixed[] $payload The response payload
|
||||
* @param string $accountSid The SID of the Account that created the Payments
|
||||
* resource.
|
||||
* @param string $callSid The SID of the Call the resource is associated with.
|
||||
* @param string $sid The SID of Payments session
|
||||
*/
|
||||
public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Marshaled Properties
|
||||
$this->properties = [
|
||||
'accountSid' => Values::array_get($payload, 'account_sid'),
|
||||
'callSid' => Values::array_get($payload, 'call_sid'),
|
||||
'sid' => Values::array_get($payload, 'sid'),
|
||||
'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')),
|
||||
'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')),
|
||||
'uri' => Values::array_get($payload, 'uri'),
|
||||
];
|
||||
|
||||
$this->solution = [
|
||||
'accountSid' => $accountSid,
|
||||
'callSid' => $callSid,
|
||||
'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 PaymentContext Context for this PaymentInstance
|
||||
*/
|
||||
protected function proxy(): PaymentContext {
|
||||
if (!$this->context) {
|
||||
$this->context = new PaymentContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid'],
|
||||
$this->solution['sid']
|
||||
);
|
||||
}
|
||||
|
||||
return $this->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the PaymentInstance
|
||||
*
|
||||
* @param string $idempotencyKey A unique token that will be used to ensure
|
||||
* that multiple API calls with the same
|
||||
* information do not result in multiple
|
||||
* transactions.
|
||||
* @param string $statusCallback Provide an absolute or relative URL to receive
|
||||
* status updates regarding your Pay session.
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return PaymentInstance Updated PaymentInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance {
|
||||
return $this->proxy()->update($idempotencyKey, $statusCallback, $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(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.Api.V2010.PaymentInstance ' . \implode(' ', $context) . ']';
|
||||
}
|
||||
}
|
||||
107
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php
vendored
Normal file
107
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Exceptions\TwilioException;
|
||||
use Twilio\ListResource;
|
||||
use Twilio\Options;
|
||||
use Twilio\Serialize;
|
||||
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 PaymentList extends ListResource {
|
||||
/**
|
||||
* Construct the PaymentList
|
||||
*
|
||||
* @param Version $version Version that contains the resource
|
||||
* @param string $accountSid The SID of the Account that created the Payments
|
||||
* resource.
|
||||
* @param string $callSid The SID of the Call the resource is associated with.
|
||||
*/
|
||||
public function __construct(Version $version, string $accountSid, string $callSid) {
|
||||
parent::__construct($version);
|
||||
|
||||
// Path Solution
|
||||
$this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ];
|
||||
|
||||
$this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Payments.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the PaymentInstance
|
||||
*
|
||||
* @param string $idempotencyKey A unique token that will be used to ensure
|
||||
* that multiple API calls with the same
|
||||
* information do not result in multiple
|
||||
* transactions.
|
||||
* @param string $statusCallback Provide an absolute or relative URL to receive
|
||||
* status updates regarding your Pay session..
|
||||
* @param array|Options $options Optional Arguments
|
||||
* @return PaymentInstance Created PaymentInstance
|
||||
* @throws TwilioException When an HTTP error occurs.
|
||||
*/
|
||||
public function create(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance {
|
||||
$options = new Values($options);
|
||||
|
||||
$data = Values::of([
|
||||
'IdempotencyKey' => $idempotencyKey,
|
||||
'StatusCallback' => $statusCallback,
|
||||
'BankAccountType' => $options['bankAccountType'],
|
||||
'ChargeAmount' => $options['chargeAmount'],
|
||||
'Currency' => $options['currency'],
|
||||
'Description' => $options['description'],
|
||||
'Input' => $options['input'],
|
||||
'MinPostalCodeLength' => $options['minPostalCodeLength'],
|
||||
'Parameter' => Serialize::jsonObject($options['parameter']),
|
||||
'PaymentConnector' => $options['paymentConnector'],
|
||||
'PaymentMethod' => $options['paymentMethod'],
|
||||
'PostalCode' => Serialize::booleanToString($options['postalCode']),
|
||||
'SecurityCode' => Serialize::booleanToString($options['securityCode']),
|
||||
'Timeout' => $options['timeout'],
|
||||
'TokenType' => $options['tokenType'],
|
||||
'ValidCardTypes' => $options['validCardTypes'],
|
||||
]);
|
||||
|
||||
$payload = $this->version->create('POST', $this->uri, [], $data);
|
||||
|
||||
return new PaymentInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a PaymentContext
|
||||
*
|
||||
* @param string $sid The SID of Payments session
|
||||
*/
|
||||
public function getContext(string $sid): PaymentContext {
|
||||
return new PaymentContext(
|
||||
$this->version,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid'],
|
||||
$sid
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.PaymentList]';
|
||||
}
|
||||
}
|
||||
350
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php
vendored
Normal file
350
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php
vendored
Normal file
@@ -0,0 +1,350 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
use Twilio\Options;
|
||||
use Twilio\Values;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
abstract class PaymentOptions {
|
||||
/**
|
||||
* @param string $bankAccountType Type of bank account if payment source is ACH.
|
||||
* @param string $chargeAmount A positive decimal value less than 1,000,000 to
|
||||
* charge against the credit card or bank account.
|
||||
* @param string $currency The currency of the `charge_amount`.
|
||||
* @param string $description The description can be used to provide more
|
||||
* details regarding the transaction.
|
||||
* @param string $input A list of inputs that should be accepted. Currently
|
||||
* only `dtmf` is supported.
|
||||
* @param int $minPostalCodeLength A positive integer that is used to validate
|
||||
* the length of the `PostalCode` inputted by
|
||||
* the user.
|
||||
* @param array $parameter A single-level JSON object used to pass custom
|
||||
* parameters to payment processors. (Required for ACH
|
||||
* payments)
|
||||
* @param string $paymentConnector This is the unique name corresponding to the
|
||||
* Pay Connector installed in the Twilio
|
||||
* Add-ons.
|
||||
* @param string $paymentMethod Type of payment being captured.
|
||||
* @param bool $postalCode Indicates whether the credit card PostalCode (zip
|
||||
* code) is a required piece of payment information
|
||||
* that must be provided by the caller.
|
||||
* @param bool $securityCode Indicates whether the credit card security code is
|
||||
* a required piece of payment information that must
|
||||
* be provided by the caller.
|
||||
* @param int $timeout The number of seconds that <Pay> should wait for the
|
||||
* caller to press a digit between each subsequent digit,
|
||||
* after the first one, before moving on to validate the
|
||||
* digits captured.
|
||||
* @param string $tokenType Indicates whether the payment method should be
|
||||
* tokenized as a `one-time` or `reusable` token.
|
||||
* @param string $validCardTypes Credit card types separated by space that Pay
|
||||
* should accept.
|
||||
* @return CreatePaymentOptions Options builder
|
||||
*/
|
||||
public static function create(string $bankAccountType = Values::NONE, string $chargeAmount = Values::NONE, string $currency = Values::NONE, string $description = Values::NONE, string $input = Values::NONE, int $minPostalCodeLength = Values::NONE, array $parameter = Values::ARRAY_NONE, string $paymentConnector = Values::NONE, string $paymentMethod = Values::NONE, bool $postalCode = Values::NONE, bool $securityCode = Values::NONE, int $timeout = Values::NONE, string $tokenType = Values::NONE, string $validCardTypes = Values::NONE): CreatePaymentOptions {
|
||||
return new CreatePaymentOptions($bankAccountType, $chargeAmount, $currency, $description, $input, $minPostalCodeLength, $parameter, $paymentConnector, $paymentMethod, $postalCode, $securityCode, $timeout, $tokenType, $validCardTypes);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $capture The piece of payment information that you wish the
|
||||
* caller to enter.
|
||||
* @param string $status Indicates whether the current payment session should
|
||||
* be cancelled or completed.
|
||||
* @return UpdatePaymentOptions Options builder
|
||||
*/
|
||||
public static function update(string $capture = Values::NONE, string $status = Values::NONE): UpdatePaymentOptions {
|
||||
return new UpdatePaymentOptions($capture, $status);
|
||||
}
|
||||
}
|
||||
|
||||
class CreatePaymentOptions extends Options {
|
||||
/**
|
||||
* @param string $bankAccountType Type of bank account if payment source is ACH.
|
||||
* @param string $chargeAmount A positive decimal value less than 1,000,000 to
|
||||
* charge against the credit card or bank account.
|
||||
* @param string $currency The currency of the `charge_amount`.
|
||||
* @param string $description The description can be used to provide more
|
||||
* details regarding the transaction.
|
||||
* @param string $input A list of inputs that should be accepted. Currently
|
||||
* only `dtmf` is supported.
|
||||
* @param int $minPostalCodeLength A positive integer that is used to validate
|
||||
* the length of the `PostalCode` inputted by
|
||||
* the user.
|
||||
* @param array $parameter A single-level JSON object used to pass custom
|
||||
* parameters to payment processors. (Required for ACH
|
||||
* payments)
|
||||
* @param string $paymentConnector This is the unique name corresponding to the
|
||||
* Pay Connector installed in the Twilio
|
||||
* Add-ons.
|
||||
* @param string $paymentMethod Type of payment being captured.
|
||||
* @param bool $postalCode Indicates whether the credit card PostalCode (zip
|
||||
* code) is a required piece of payment information
|
||||
* that must be provided by the caller.
|
||||
* @param bool $securityCode Indicates whether the credit card security code is
|
||||
* a required piece of payment information that must
|
||||
* be provided by the caller.
|
||||
* @param int $timeout The number of seconds that <Pay> should wait for the
|
||||
* caller to press a digit between each subsequent digit,
|
||||
* after the first one, before moving on to validate the
|
||||
* digits captured.
|
||||
* @param string $tokenType Indicates whether the payment method should be
|
||||
* tokenized as a `one-time` or `reusable` token.
|
||||
* @param string $validCardTypes Credit card types separated by space that Pay
|
||||
* should accept.
|
||||
*/
|
||||
public function __construct(string $bankAccountType = Values::NONE, string $chargeAmount = Values::NONE, string $currency = Values::NONE, string $description = Values::NONE, string $input = Values::NONE, int $minPostalCodeLength = Values::NONE, array $parameter = Values::ARRAY_NONE, string $paymentConnector = Values::NONE, string $paymentMethod = Values::NONE, bool $postalCode = Values::NONE, bool $securityCode = Values::NONE, int $timeout = Values::NONE, string $tokenType = Values::NONE, string $validCardTypes = Values::NONE) {
|
||||
$this->options['bankAccountType'] = $bankAccountType;
|
||||
$this->options['chargeAmount'] = $chargeAmount;
|
||||
$this->options['currency'] = $currency;
|
||||
$this->options['description'] = $description;
|
||||
$this->options['input'] = $input;
|
||||
$this->options['minPostalCodeLength'] = $minPostalCodeLength;
|
||||
$this->options['parameter'] = $parameter;
|
||||
$this->options['paymentConnector'] = $paymentConnector;
|
||||
$this->options['paymentMethod'] = $paymentMethod;
|
||||
$this->options['postalCode'] = $postalCode;
|
||||
$this->options['securityCode'] = $securityCode;
|
||||
$this->options['timeout'] = $timeout;
|
||||
$this->options['tokenType'] = $tokenType;
|
||||
$this->options['validCardTypes'] = $validCardTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of bank account if payment source is ACH. One of `consumer-checking`, `consumer-savings`, or `commercial-checking`. The default value is `consumer-checking`.
|
||||
*
|
||||
* @param string $bankAccountType Type of bank account if payment source is ACH.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setBankAccountType(string $bankAccountType): self {
|
||||
$this->options['bankAccountType'] = $bankAccountType;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize.
|
||||
*
|
||||
* @param string $chargeAmount A positive decimal value less than 1,000,000 to
|
||||
* charge against the credit card or bank account.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setChargeAmount(string $chargeAmount): self {
|
||||
$this->options['chargeAmount'] = $chargeAmount;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted.
|
||||
*
|
||||
* @param string $currency The currency of the `charge_amount`.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setCurrency(string $currency): self {
|
||||
$this->options['currency'] = $currency;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions.
|
||||
*
|
||||
* @param string $description The description can be used to provide more
|
||||
* details regarding the transaction.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setDescription(string $description): self {
|
||||
$this->options['description'] = $description;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs.
|
||||
*
|
||||
* @param string $input A list of inputs that should be accepted. Currently
|
||||
* only `dtmf` is supported.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setInput(string $input): self {
|
||||
$this->options['input'] = $input;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits.
|
||||
*
|
||||
* @param int $minPostalCodeLength A positive integer that is used to validate
|
||||
* the length of the `PostalCode` inputted by
|
||||
* the user.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setMinPostalCodeLength(int $minPostalCodeLength): self {
|
||||
$this->options['minPostalCodeLength'] = $minPostalCodeLength;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors).
|
||||
*
|
||||
* @param array $parameter A single-level JSON object used to pass custom
|
||||
* parameters to payment processors. (Required for ACH
|
||||
* payments)
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setParameter(array $parameter): self {
|
||||
$this->options['parameter'] = $parameter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`.
|
||||
*
|
||||
* @param string $paymentConnector This is the unique name corresponding to the
|
||||
* Pay Connector installed in the Twilio
|
||||
* Add-ons.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setPaymentConnector(string $paymentConnector): self {
|
||||
$this->options['paymentConnector'] = $paymentConnector;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type of payment being captured. One of `credit-card` or `ach-debit`. The default value is `credit-card`.
|
||||
*
|
||||
* @param string $paymentMethod Type of payment being captured.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setPaymentMethod(string $paymentMethod): self {
|
||||
$this->options['paymentMethod'] = $paymentMethod;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`.
|
||||
*
|
||||
* @param bool $postalCode Indicates whether the credit card PostalCode (zip
|
||||
* code) is a required piece of payment information
|
||||
* that must be provided by the caller.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setPostalCode(bool $postalCode): self {
|
||||
$this->options['postalCode'] = $postalCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`.
|
||||
*
|
||||
* @param bool $securityCode Indicates whether the credit card security code is
|
||||
* a required piece of payment information that must
|
||||
* be provided by the caller.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setSecurityCode(bool $securityCode): self {
|
||||
$this->options['securityCode'] = $securityCode;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`.
|
||||
*
|
||||
* @param int $timeout The number of seconds that <Pay> should wait for the
|
||||
* caller to press a digit between each subsequent digit,
|
||||
* after the first one, before moving on to validate the
|
||||
* digits captured.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setTimeout(int $timeout): self {
|
||||
$this->options['timeout'] = $timeout;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the payment method should be tokenized as a `one-time` or `reusable` token. The default value is `reusable`. Do not enter a charge amount when tokenizing. If a charge amount is entered, the payment method will be charged and not tokenized.
|
||||
*
|
||||
* @param string $tokenType Indicates whether the payment method should be
|
||||
* tokenized as a `one-time` or `reusable` token.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setTokenType(string $tokenType): self {
|
||||
$this->options['tokenType'] = $tokenType;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex`
|
||||
*
|
||||
* @param string $validCardTypes Credit card types separated by space that Pay
|
||||
* should accept.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setValidCardTypes(string $validCardTypes): self {
|
||||
$this->options['validCardTypes'] = $validCardTypes;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.CreatePaymentOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
|
||||
class UpdatePaymentOptions extends Options {
|
||||
/**
|
||||
* @param string $capture The piece of payment information that you wish the
|
||||
* caller to enter.
|
||||
* @param string $status Indicates whether the current payment session should
|
||||
* be cancelled or completed.
|
||||
*/
|
||||
public function __construct(string $capture = Values::NONE, string $status = Values::NONE) {
|
||||
$this->options['capture'] = $capture;
|
||||
$this->options['status'] = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* The piece of payment information that you wish the caller to enter. Must be one of `payment-card-number`, `expiration-date`, `security-code`, `postal-code`, `bank-routing-number`, or `bank-account-number`.
|
||||
*
|
||||
* @param string $capture The piece of payment information that you wish the
|
||||
* caller to enter.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setCapture(string $capture): self {
|
||||
$this->options['capture'] = $capture;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the current payment session should be cancelled or completed. When `cancel` the payment session is cancelled. When `complete`, Twilio sends the payment information to the selected Pay Connector for processing.
|
||||
*
|
||||
* @param string $status Indicates whether the current payment session should
|
||||
* be cancelled or completed.
|
||||
* @return $this Fluent Builder
|
||||
*/
|
||||
public function setStatus(string $status): self {
|
||||
$this->options['status'] = $status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
$options = \http_build_query(Values::of($this->options), '', ' ');
|
||||
return '[Twilio.Api.V2010.UpdatePaymentOptions ' . $options . ']';
|
||||
}
|
||||
}
|
||||
53
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php
vendored
Normal file
53
vendor/twilio/sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This code was generated by
|
||||
* \ / _ _ _| _ _
|
||||
* | (_)\/(_)(_|\/| |(/_ v1.0.0
|
||||
* / /
|
||||
*/
|
||||
|
||||
namespace Twilio\Rest\Api\V2010\Account\Call;
|
||||
|
||||
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 PaymentPage 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 PaymentInstance \Twilio\Rest\Api\V2010\Account\Call\PaymentInstance
|
||||
*/
|
||||
public function buildInstance(array $payload): PaymentInstance {
|
||||
return new PaymentInstance(
|
||||
$this->version,
|
||||
$payload,
|
||||
$this->solution['accountSid'],
|
||||
$this->solution['callSid']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide a friendly representation
|
||||
*
|
||||
* @return string Machine friendly representation
|
||||
*/
|
||||
public function __toString(): string {
|
||||
return '[Twilio.Api.V2010.PaymentPage]';
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user